chiark / gitweb /
shared/unit-name: fix gcc5 warning
authorDaniel Mack <daniel@zonque.org>
Tue, 24 Feb 2015 15:18:43 +0000 (16:18 +0100)
committerDaniel Mack <daniel@zonque.org>
Tue, 24 Feb 2015 15:26:30 +0000 (16:26 +0100)
Fix the following gcc5 warning:

  CC       src/shared/libsystemd_shared_la-unit-name.lo
src/shared/unit-name.c: In function 'unit_name_is_valid':
src/shared/unit-name.c:102:34: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
                 if (!template_ok == TEMPLATE_VALID && at+1 == e)
                                  ^

src/shared/unit-name.c

index 0cc06f4f89cd9d1791651aebb6b7d7aaee00b519..86d6ce3df1583bb3fd67de6a6ccb3d9f0d4e73b3 100644 (file)
@@ -99,7 +99,7 @@ bool unit_name_is_valid(const char *n, enum template_valid template_ok) {
                 if (at == n)
                         return false;
 
-                if (!template_ok == TEMPLATE_VALID && at+1 == e)
+                if (template_ok != TEMPLATE_VALID && at+1 == e)
                         return false;
         }