diff options
Diffstat (limited to 'src/lib/libc/string/strerror.c')
-rw-r--r-- | src/lib/libc/string/strerror.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/lib/libc/string/strerror.c b/src/lib/libc/string/strerror.c index 6496f50afd..edb6af7386 100644 --- a/src/lib/libc/string/strerror.c +++ b/src/lib/libc/string/strerror.c | |||
@@ -28,23 +28,17 @@ | |||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #if defined(LIBC_SCCS) && !defined(lint) | 30 | #if defined(LIBC_SCCS) && !defined(lint) |
31 | static char *rcsid = "$OpenBSD: strerror.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $"; | 31 | static char *rcsid = "$OpenBSD: strerror.c,v 1.6 2004/05/03 05:07:34 espie Exp $"; |
32 | #endif /* LIBC_SCCS and not lint */ | 32 | #endif /* LIBC_SCCS and not lint */ |
33 | 33 | ||
34 | #include <string.h> | 34 | #include <string.h> |
35 | #include <limits.h> | 35 | #include <limits.h> |
36 | 36 | ||
37 | /* | ||
38 | * Since perror() is not allowed to change the contents of strerror()'s | ||
39 | * static buffer, both functions supply their own buffers to the | ||
40 | * internal function __strerror(). | ||
41 | */ | ||
42 | |||
43 | extern char *__strerror(int, char *); | ||
44 | |||
45 | char * | 37 | char * |
46 | strerror(int num) | 38 | strerror(int num) |
47 | { | 39 | { |
48 | static char buf[NL_TEXTMAX]; | 40 | static char buf[NL_TEXTMAX]; |
49 | return __strerror(num, buf); | 41 | |
42 | (void)strerror_r(num, buf, sizeof(buf)); | ||
43 | return (buf); | ||
50 | } | 44 | } |