summaryrefslogtreecommitdiff
path: root/src/lib/libc/string/strerror.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libc/string/strerror.c')
-rw-r--r--src/lib/libc/string/strerror.c14
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)
31static char *rcsid = "$OpenBSD: strerror.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $"; 31static 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
43extern char *__strerror(int, char *);
44
45char * 37char *
46strerror(int num) 38strerror(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}