]> granicus.if.org Git - cronie/commitdiff
cron: fix type in comparison
authorSami Kerola <kerolasa@iki.fi>
Sun, 31 Mar 2019 11:52:37 +0000 (12:52 +0100)
committerSami Kerola <kerolasa@iki.fi>
Sat, 13 Apr 2019 05:11:45 +0000 (06:11 +0100)
Use of size_t in this context should be also safer from bit shift
perspective, risk of overflowing it is smaller.

cronnext.c:80:16: warning: comparison between signed and unsigned integer
expressions [-Wsign-compare]
  for (f = 1; f < sizeof(flagname);  f = f << 1)
                ^

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
src/cronnext.c

index bd6545b8da3c7f0d314c96a197918d7ed7bb5594..f6ac97f748dae55fa25f9822da4611a0648ba843 100644 (file)
@@ -81,7 +81,7 @@ const char *flagname[]= {
 };
 
 void printflags(char *indent, int flags) {
-       int f;
+       size_t f;
        int first = 1;
 
        printf("%s    flagnames:", indent);