From: Karel Zak Date: Thu, 15 Oct 2009 23:28:41 +0000 (+0200) Subject: kill: use c.h X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf969be77de7a38848820cd9dee9205d8a4462c6;p=util-linux kill: use c.h Signed-off-by: Karel Zak --- diff --git a/misc-utils/kill.c b/misc-utils/kill.c index 579ae8ab..61e61a32 100644 --- a/misc-utils/kill.c +++ b/misc-utils/kill.c @@ -49,11 +49,11 @@ #include /* for isdigit() */ #include #include + +#include "c.h" #include "kill.h" #include "nls.h" -#define SIZE(a) (sizeof(a)/sizeof(a[0])) - struct signv { char *name; int val; @@ -286,7 +286,7 @@ int signame_to_signum (char *sig) if (! strncasecmp (sig, "sig", 3)) sig += 3; - for (n = 0; n < SIZE(sys_signame); n++) { + for (n = 0; n < ARRAY_SIZE(sys_signame); n++) { if (! strcasecmp (sys_signame[n].name, sig)) return sys_signame[n].val; } @@ -319,7 +319,7 @@ void printsig (int sig) { int n; - for (n = 0; n < SIZE(sys_signame); n++) { + for (n = 0; n < ARRAY_SIZE(sys_signame); n++) { if (sys_signame[n].val == sig) { printf ("%s\n", sys_signame[n].name); return; @@ -333,7 +333,7 @@ void printsignals (FILE *fp) int n, lth; int lpos = 0; - for (n = 0; n < SIZE(sys_signame); n++) { + for (n = 0; n < ARRAY_SIZE(sys_signame); n++) { lth = 1+strlen(sys_signame[n].name); if (lpos+lth > 72) { fputc ('\n', fp);