summaryrefslogtreecommitdiffstats
path: root/misc-utils/ddate.c
diff options
context:
space:
mode:
authorKarel Zak2011-03-18 10:27:09 +0100
committerKarel Zak2011-03-18 10:27:09 +0100
commit95cc3573e170b324b80074e92056bff43ebb730d (patch)
tree5f38d9798241bbc6eec8efb89968a22c89241bc6 /misc-utils/ddate.c
parentddate: remove non-ascii chars from ddate (diff)
downloadkernel-qcow2-util-linux-95cc3573e170b324b80074e92056bff43ebb730d.tar.gz
kernel-qcow2-util-linux-95cc3573e170b324b80074e92056bff43ebb730d.tar.xz
kernel-qcow2-util-linux-95cc3573e170b324b80074e92056bff43ebb730d.zip
ddate: use ARRAY_SIZE
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'misc-utils/ddate.c')
-rw-r--r--misc-utils/ddate.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/misc-utils/ddate.c b/misc-utils/ddate.c
index 62f830d67..59e1e132f 100644
--- a/misc-utils/ddate.c
+++ b/misc-utils/ddate.c
@@ -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",