]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
ddate: use ARRAY_SIZE
authorKarel Zak <kzak@redhat.com>
Fri, 18 Mar 2011 09:27:09 +0000 (10:27 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 18 Mar 2011 09:27:09 +0000 (10:27 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/ddate.c

index 62f830d6727c5a21af6b9a2aea75fb535289f138..59e1e132f04a4ba97be0b009be1a149080a57842 100644 (file)
@@ -61,7 +61,9 @@
 #include <string.h>
 #include <time.h>
 #include <stdio.h>
+
 #include "nls.h"
+#include "c.h"
 
 #ifndef __GNUC__
 #define inline /* foo */
@@ -265,9 +267,9 @@ void format(char *buf, const char* fmt, struct disc_time dt)
                case 'N': if(dt.day!=4&&dt.day!=49) goto eschaton; break;
                case 'n': *(bufptr++)='\n'; break;
                case 't': *(bufptr++)='\t'; break;
-                   
+
                case 'Y': sprintf(snarf, "%d", dt.year); wibble=snarf; break;
-               case '.': wibble=sel(excl, sizeof(excl)/sizeof(excl[0]));
+               case '.': wibble=sel(excl, ARRAY_SIZE(excl));
                    break;
 #ifdef KILL_BOB
                case 'X': sprintf(snarf, "%d",