diff options
| author | Conrad Meyer <cem@FreeBSD.org> | 2016-05-12 04:08:45 +0000 |
|---|---|---|
| committer | Conrad Meyer <cem@FreeBSD.org> | 2016-05-12 04:08:45 +0000 |
| commit | 83095e1ee2299fccc2b88d8f00a7321c86d88a46 (patch) | |
| tree | c8b7b8bce2d82b0133557c8c0139143cb4d7d873 /lib/libc | |
| parent | d0725e2250a7bb232faf10d9668cbbc56cd2485c (diff) | |
Notes
Diffstat (limited to 'lib/libc')
| -rw-r--r-- | lib/libc/tests/stdio/print_positional_test.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libc/tests/stdio/print_positional_test.c b/lib/libc/tests/stdio/print_positional_test.c index 1de43a1b499f8..9c9ec314d62dd 100644 --- a/lib/libc/tests/stdio/print_positional_test.c +++ b/lib/libc/tests/stdio/print_positional_test.c @@ -32,6 +32,7 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); +#include <sys/param.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -94,7 +95,7 @@ ATF_TC_WITHOUT_HEAD(positional_wide); ATF_TC_BODY(positional_wide, tc) { - swprintf(wbuf1, sizeof wbuf1, + swprintf(wbuf1, nitems(wbuf1), L"|xx %1$s %2$s %3$s %4$s\n" "|xx %5$s %6$s %7$s %8$s\n" "|xx %9$s %10$s %11$s %12$s\n" @@ -117,7 +118,7 @@ ATF_TC_BODY(positional_wide, tc) "43", "44", 45, -1L, 1LL, -1, 1LL ); temp = correct; - mbsrtowcs(wbuf2, &temp, sizeof wbuf2, NULL); + mbsrtowcs(wbuf2, &temp, nitems(wbuf2), NULL); ATF_REQUIRE_MSG(wcscmp(wbuf1, wbuf2) == 0, "buffers didn't match"); } @@ -139,7 +140,7 @@ ATF_TC_BODY(positional_precision_wide, tc) swprintf(wbuf1, sizeof buf, L"%2$.*4$s %2$.*3$s %1$s", "BSD", "bsd", 2, 1); temp = correct2; - mbsrtowcs(wbuf2, &temp, sizeof wbuf2, NULL); + mbsrtowcs(wbuf2, &temp, nitems(wbuf2), NULL); ATF_REQUIRE_MSG(wcscmp(wbuf1, wbuf2) == 0, "buffers didn't match"); } |
