Mercurial > cpython-lru_cache-weakref
diff Python/strerror.c @ 21077:379fc66f4c96 legacy-trunk
Use PyOS_snprintf instead of sprintf.
| author | Jeremy Hylton <jeremy@alum.mit.edu> |
|---|---|
| date | Wed, 28 Nov 2001 20:42:20 +0000 |
| parents | 6f6f965c5e2d |
| children | 86fdf8fe7f17 |
line wrap: on
line diff
--- a/Python/strerror.c Wed Nov 28 20:37:25 2001 +0000 +++ b/Python/strerror.c Wed Nov 28 20:42:20 2001 +0000 @@ -3,6 +3,7 @@ Author: Guido van Rossum, CWI Amsterdam, Oct. 1990, <guido@cwi.nl>. */ #include <stdio.h> +#include "Python.h" extern int sys_nerr; extern char *sys_errlist[]; @@ -13,7 +14,7 @@ static char buf[20]; if (err >= 0 && err < sys_nerr) return sys_errlist[err]; - sprintf(buf, "Unknown errno %d", err); + PyOS_snprintf(buf, sizeof(buf), "Unknown errno %d", err); return buf; }
