From 350e448f76ffc612cb80cf82aed1616288d25cc3 Mon Sep 17 00:00:00 2001 From: Jeremy Hylton Date: Wed, 28 Nov 2001 20:42:20 +0000 Subject: Use PyOS_snprintf instead of sprintf. --- Python/strerror.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Python/strerror.c') 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, . */ #include +#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; } -- cgit v1.2.1