diff options
Diffstat (limited to 'Python/strerror.c')
-rw-r--r-- | Python/strerror.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/strerror.c b/Python/strerror.c index b803b29835..aeb7dd5734 100644 --- a/Python/strerror.c +++ b/Python/strerror.c @@ -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 @@ strerror(int err) 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; } |