about summary refs log tree commit diff
path: root/stdio-common/tst-swprintf.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2017-11-02 12:14:51 +0100
committerFlorian Weimer <fweimer@redhat.com>2017-11-02 12:45:20 +0100
commitd10b132bf5393e648a1c64569746c8e886d50702 (patch)
tree66a444574feee728a133c754c9527c02fe25e249 /stdio-common/tst-swprintf.c
parentc94a5688fb1228a862b2d4a3f1239cdc0e3349e5 (diff)
downloadglibc-d10b132bf5393e648a1c64569746c8e886d50702.tar.gz
glibc-d10b132bf5393e648a1c64569746c8e886d50702.tar.xz
glibc-d10b132bf5393e648a1c64569746c8e886d50702.zip
stdio-common: Use array_length and array_end macros
Diffstat (limited to 'stdio-common/tst-swprintf.c')
-rw-r--r--stdio-common/tst-swprintf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/stdio-common/tst-swprintf.c b/stdio-common/tst-swprintf.c
index ce62c6bf68..07194eb67d 100644
--- a/stdio-common/tst-swprintf.c
+++ b/stdio-common/tst-swprintf.c
@@ -1,3 +1,4 @@
+#include <array_length.h>
 #include <locale.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -16,7 +17,6 @@ static int
 do_test (void)
 {
   wchar_t buf[1000];
-#define nbuf (sizeof (buf) / sizeof (buf[0]))
   int result = 0;
   ssize_t n;
 
@@ -27,7 +27,7 @@ do_test (void)
     }
 
 #define CHECK(fmt, nexp, exp) \
-  n = swprintf (buf, nbuf, fmt, input);					      \
+  n = swprintf (buf, array_length (buf), fmt, input);			      \
   if (n != nexp)							      \
     {									      \
       printf ("swprintf (.., .., L\"%ls\", \"%ls\") return %d, not %d\n",     \