about summary refs log tree commit diff
path: root/stdio-common/tst-fphex.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-fphex.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-fphex.c')
-rw-r--r--stdio-common/tst-fphex.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/stdio-common/tst-fphex.c b/stdio-common/tst-fphex.c
index c2e8961d62..efba482537 100644
--- a/stdio-common/tst-fphex.c
+++ b/stdio-common/tst-fphex.c
@@ -1,5 +1,6 @@
 /* Test program for %a printf formats.  */
 
+#include <array_length.h>
 #include <stdio.h>
 #include <string.h>
 
@@ -49,12 +50,10 @@ do_test (void)
   const struct testcase *t;
   int result = 0;
 
-  for (t = testcases;
-       t < &testcases[sizeof testcases / sizeof testcases[0]];
-       ++t)
+  for (t = testcases; t < array_end (testcases); ++t)
     {
       CHAR_T buf[1024];
-      int n = SPRINT (buf, sizeof buf / sizeof (buf[0]), t->fmt, t->value);
+      int n = SPRINT (buf, array_length (buf), t->fmt, t->value);
       if (n != STR_LEN (t->expect) || STR_CMP (buf, t->expect) != 0)
 	{
 	  PRINT (L_("" S "\tExpected \"" S "\" (%Zu)\n\tGot      \""