summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--regress/lib/libc/strerror/strerror_test.c9
-rw-r--r--regress/lib/libc/strerror/valid.ok44
2 files changed, 27 insertions, 26 deletions
diff --git a/regress/lib/libc/strerror/strerror_test.c b/regress/lib/libc/strerror/strerror_test.c
index 061cda6fc31..670f8c5616d 100644
--- a/regress/lib/libc/strerror/strerror_test.c
+++ b/regress/lib/libc/strerror/strerror_test.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strerror_test.c,v 1.2 2004/05/02 22:34:29 espie Exp $ */
+/* $OpenBSD: strerror_test.c,v 1.3 2005/05/08 06:34:25 otto Exp $ */
/*
* Copyright (c) 2004 Marc Espie <espie@cvs.openbsd.org>
*
@@ -22,14 +22,15 @@
void
check_strerror_r(int val)
{
- char buffer[NL_TEXTMAX];
+ char buffer[NL_TEXTMAX + 1];
int i, r;
- memset(buffer, 0, sizeof(buffer));
+ memset(buffer, 'X', sizeof(buffer) - 1);
+ buffer[sizeof(buffer) - 1] = '\0';
(void)strerror_r(val, NULL, 0); /* XXX */
for (i = 0; i < 25; i++) {
r = strerror_r(val, buffer, i);
- printf("%d %d %lu: %s\n", i, r, strlen(buffer), buffer);
+ printf("%d %d %zu: %s\n", i, r, strlen(buffer), buffer);
}
}
diff --git a/regress/lib/libc/strerror/valid.ok b/regress/lib/libc/strerror/valid.ok
index 9f7529e97e0..d3061a10472 100644
--- a/regress/lib/libc/strerror/valid.ok
+++ b/regress/lib/libc/strerror/valid.ok
@@ -4,7 +4,7 @@ Undefined error: 0
Unknown error: 2147483647
Unknown error: -2147483648
Operation not permitted
-0 34 0:
+0 34 255: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1 34 0:
2 34 1: O
3 34 2: Op
@@ -29,27 +29,27 @@ Operation not permitted
22 34 21: Operation not permitt
23 34 22: Operation not permitte
24 0 23: Operation not permitted
-0 22 0:
-1 22 0:
-2 22 1: U
-3 22 2: Un
-4 22 3: Unk
-5 22 4: Unkn
-6 22 5: Unkno
-7 22 6: Unknow
-8 22 7: Unknown
-9 22 8: Unknown
-10 22 9: Unknown e
-11 22 10: Unknown er
-12 22 11: Unknown err
-13 22 12: Unknown erro
-14 22 13: Unknown error
-15 22 14: Unknown error:
-16 22 15: Unknown error:
-17 22 16: Unknown error: 2
-18 22 17: Unknown error: 21
-19 22 18: Unknown error: 213
-20 22 19: Unknown error: 2134
+0 34 255: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+1 34 0:
+2 34 1: U
+3 34 2: Un
+4 34 3: Unk
+5 34 4: Unkn
+6 34 5: Unkno
+7 34 6: Unknow
+8 34 7: Unknown
+9 34 8: Unknown
+10 34 9: Unknown e
+11 34 10: Unknown er
+12 34 11: Unknown err
+13 34 12: Unknown erro
+14 34 13: Unknown error
+15 34 14: Unknown error:
+16 34 15: Unknown error:
+17 34 15: Unknown error:
+18 34 15: Unknown error:
+19 34 15: Unknown error:
+20 34 15: Unknown error:
21 22 20: Unknown error: 21345
22 22 20: Unknown error: 21345
23 22 20: Unknown error: 21345