Fix issue2588: Do not execute str[size-1] = '\0' when a 0 size is
passed in.  (The assert won't prevent this in non-debug builds).
diff --git a/Python/mysnprintf.c b/Python/mysnprintf.c
index 8c47794..3173863 100644
--- a/Python/mysnprintf.c
+++ b/Python/mysnprintf.c
@@ -98,7 +98,8 @@
 	PyMem_FREE(buffer);
 #endif
 Done:
-	str[size-1] = '\0';
+	if (size > 0)
+		str[size-1] = '\0';
 	return len;
 #undef _PyOS_vsnprintf_EXTRA_SPACE
 }