File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -242,7 +242,7 @@ time_strftime(self, args)
242242 /* I hate these functions that presume you know how big the output
243243 * will be ahead of time...
244244 */
245- for (i = 1024 ; i < 8192 ; i += 1024 ) {
245+ for (i = 1024 ; i <= 8192 ; i += 1024 ) {
246246 outbuf = malloc (i );
247247 if (outbuf == NULL ) {
248248 return PyErr_NoMemory ();
@@ -255,7 +255,9 @@ time_strftime(self, args)
255255 }
256256 free (outbuf );
257257 }
258- return PyErr_NoMemory ();
258+ PyErr_SetString (PyExc_ValueError ,
259+ "bad strftime format or result too big" );
260+ return NULL ;
259261}
260262#endif /* HAVE_STRFTIME */
261263
@@ -443,6 +445,7 @@ floatsleep(double secs)
443445 double secs ;
444446#endif /* MPW */
445447{
448+ /* XXX Should test for MS_WIN32 first! */
446449#ifdef HAVE_SELECT
447450 struct timeval t ;
448451 double frac ;
You can’t perform that action at this time.
0 commit comments