]> granicus.if.org Git - python/commitdiff
Fix bogus assertion.
authorAlexandre Vassalotti <alexandre@peadrop.com>
Sat, 27 Dec 2008 09:49:09 +0000 (09:49 +0000)
committerAlexandre Vassalotti <alexandre@peadrop.com>
Sat, 27 Dec 2008 09:49:09 +0000 (09:49 +0000)
Objects/unicodeobject.c

index fa74631225a6e27241683a2d6be5ecb2edd92bfc..1b6a4538a94ff48527dc6e6360c4ddef76e80af6 100644 (file)
@@ -3845,7 +3845,7 @@ static PyObject *unicode_encode_ucs1(const Py_UNICODE *p,
     /* Resize if we allocated to much */
     size = str - PyBytes_AS_STRING(res);
     if (size < ressize) { /* If this falls res will be NULL */
-        assert(size > 0);
+        assert(size >= 0);
         if (_PyBytes_Resize(&res, size) < 0)
             goto onError;
     }