chiark / gitweb /
shared/time-util: fix gcc5 warning
authorDaniel Mack <daniel@zonque.org>
Tue, 24 Feb 2015 12:26:09 +0000 (13:26 +0100)
committerDaniel Mack <daniel@zonque.org>
Tue, 24 Feb 2015 12:26:47 +0000 (13:26 +0100)
  CC       src/shared/libsystemd_shared_la-time-util.lo
src/shared/time-util.c: In function 'parse_nsec':
src/shared/time-util.c:789:25: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
                 if (!*s != 0)
                         ^

src/shared/time-util.c

index 947ac1fcfb23075f1abd69119568fe32ebaaad3a..1c36c577c4af36c9255554831161c8e65cb26171 100644 (file)
@@ -786,7 +786,7 @@ int parse_nsec(const char *t, nsec_t *nsec) {
         s = startswith(p, "infinity");
         if (s) {
                 s += strspn(s, WHITESPACE);
-                if (!*s != 0)
+                if (*s != 0)
                         return -EINVAL;
 
                 *nsec = NSEC_INFINITY;