summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2006-06-06 00:25:07 (GMT)
committerTim Peters <tim.peters@gmail.com>2006-06-06 00:25:07 (GMT)
commit02f1d0dc78aefa9a15fc6291fe2631f67f2fa6ef (patch)
tree389cb037b5bf0eacde05580cb12d353018050e41 /Python
parent3c228b19f049d71c47714e7a2ced5ab4d163be78 (diff)
downloadcpython-02f1d0dc78aefa9a15fc6291fe2631f67f2fa6ef.zip
cpython-02f1d0dc78aefa9a15fc6291fe2631f67f2fa6ef.tar.gz
cpython-02f1d0dc78aefa9a15fc6291fe2631f67f2fa6ef.tar.bz2
_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.
Diffstat (limited to 'Python')
-rw-r--r--Python/sysmodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 9de46a9..785653e 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);