aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/string
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2018-12-27 13:02:15 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2018-12-27 13:02:15 +0000
commitcd49e866fcf9b07db5e0e79c2ed8b07e4e21a9c1 (patch)
tree0da004c533fd2d244e46f7f695698860bfa58adc /lib/libc/string
parent2cb73efc0d44459b82fcdc362d9878e560291403 (diff)
Notes
Diffstat (limited to 'lib/libc/string')
-rw-r--r--lib/libc/string/strerror.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/libc/string/strerror.c b/lib/libc/string/strerror.c
index c5ac55ed3bc1e..be3732d5b9e34 100644
--- a/lib/libc/string/strerror.c
+++ b/lib/libc/string/strerror.c
@@ -46,15 +46,12 @@ __FBSDID("$FreeBSD$");
#include "errlst.h"
-#define UPREFIX "Unknown error"
-
/*
- * Define a buffer size big enough to describe a 64-bit signed integer
- * converted to ASCII decimal (19 bytes), with an optional leading sign
- * (1 byte); finally, we get the prefix, delimiter (": ") and a trailing
- * NUL from UPREFIX.
+ * Define buffer big enough to contain delimiter (": ", 2 bytes),
+ * 64-bit signed integer converted to ASCII decimal (19 bytes) with
+ * optional leading sign (1 byte), and a trailing NUL.
*/
-#define EBUFSIZE (20 + 2 + sizeof(UPREFIX))
+#define EBUFSIZE (2 + 19 + 1 + 1)
/*
* Doing this by hand instead of linking with stdio(3) avoids bloat for
@@ -94,9 +91,9 @@ strerror_r(int errnum, char *strerrbuf, size_t buflen)
if (errnum < 0 || errnum >= __hidden_sys_nerr) {
errstr(errnum,
#if defined(NLS)
- catgets(catd, 1, 0xffff, UPREFIX),
+ catgets(catd, 1, 0xffff, __uprefix),
#else
- UPREFIX,
+ __uprefix,
#endif
strerrbuf, buflen);
retval = EINVAL;