From 32348a71ee7458de8c2abe4e185ee07f7f097c76 Mon Sep 17 00:00:00 2001 From: "tim.peters" Date: Tue, 6 Jun 2006 00:25:07 +0000 Subject: [PATCH] _PySys_Init(): It's rarely a good idea to size a buffer to the exact maximum size someone guesses is needed. In this case, if we're really worried about extreme integers, then "cp%d" can actually need 14 bytes (2 for "cp" + 1 for \0 at the end + 11 for -(2**31-1)). So reserve 128 bytes instead -- nothing is actually saved by making a stack-local buffer tiny. git-svn-id: http://svn.python.org/projects/python/trunk@46686 6015fed2-1504-0410-9fe1-9d1591cc4771 --- Python/sysmodule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 9de46a9c49..785653ede0 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -1031,7 +1031,7 @@ _PySys_Init(void) PyObject *sysin, *sysout, *syserr; char *s; #ifdef MS_WINDOWS - char buf[13]; + char buf[128]; #endif m = Py_InitModule3("sys", sys_methods, sys_doc); -- 2.11.4.GIT