Anonymous avatar Anonymous committed b7d11eb

DO not use SSIZE_MAX - it's POSIX - use SIZE_MAX instead.

Comments (0)

Files changed (2)

src/base/streamwrapper.c

     tmp = Bytes_AS_STRING (result);
 
     off = 0;
-    while ((_read - off) > SSIZE_MAX)
+    while ((_read - off) > SIZE_MAX)
     {
-        memcpy (ptr + off, tmp + off, SSIZE_MAX);
-        off += SSIZE_MAX;
+        memcpy (ptr + off, tmp + off, SIZE_MAX);
+        off += SIZE_MAX;
     }
     memcpy (ptr + off, tmp + off, (size_t) (_read - off));
     Py_DECREF (result);
     tmp = Bytes_AS_STRING (result);
 
     off = 0;
-    while ((_read - off) > SSIZE_MAX)
+    while ((_read - off) > SIZE_MAX)
     {
-        memcpy (ptr + off, tmp + off, SSIZE_MAX);
-        off += SSIZE_MAX;
+        memcpy (ptr + off, tmp + off, SIZE_MAX);
+        off += SIZE_MAX;
     }
     memcpy (ptr + off, tmp + off, (size_t) (_read - off));
     Py_DECREF (result);

src/sdl/timemod.c

 #endif
 
     DEBUG_P ("SWAPPED STATE");
-    if (timerdata->id == NULL)
+    if (timerdata->id == NULL || timerdata->wait == NULL)
     {
         DEBUG_P ("CALLBACK DEFUNCT");
         goto ret;
     if (!data)
         return;
 
+    DEBUG_P ("FREEING");
     if (data->id)
         SDL_RemoveTimer (data->id);
     data->id = NULL;
 
     if (PySequence_DelItem (state->timerlist, pos) == -1)
         return NULL;
-    
+
     Py_RETURN_NONE;
 }
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.