_PyUnicodeWriter_PrepareInternal(): make the assertion more strict
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 7c079e0..d0b285a 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -13307,7 +13307,8 @@
     PyObject *newbuffer;
 
     /* ensure that the _PyUnicodeWriter_Prepare macro was used */
-    assert(maxchar > writer->maxchar || length > 0);
+    assert((maxchar > writer->maxchar && length >= 0)
+           || length > 0);
 
     if (length > PY_SSIZE_T_MAX - writer->pos) {
         PyErr_NoMemory();