chiark / gitweb /
Always use errno > 0 to help gcc
[elogind.git] / src / libsystemd-bus / sd-bus.c
index c82b738e028be9aa3d44a1c0ca0e1a553fff2f8f..08a218b7cccbf7174f16f5b2da789fa1a194ffc3 100644 (file)
@@ -507,7 +507,7 @@ static int parse_exec_address(sd_bus *b, const char **p, char **guid) {
 
                         errno = 0;
                         ul = strtoul(*p + 4, (char**) p, 10);
-                        if (errno != 0 || **p != '=' || ul > 256) {
+                        if (errno > 0 || **p != '=' || ul > 256) {
                                 r = -EINVAL;
                                 goto fail;
                         }
@@ -539,8 +539,10 @@ static int parse_exec_address(sd_bus *b, const char **p, char **guid) {
                 skip_address_key(p);
         }
 
-        if (!path)
+        if (!path) {
+                r = -EINVAL;
                 goto fail;
+        }
 
         /* Make sure there are no holes in the array, with the
          * exception of argv[0] */
@@ -1942,7 +1944,7 @@ static int bus_add_object(
                 return -ENOMEM;
 
         c->path = strdup(path);
-        if (!path) {
+        if (!c->path) {
                 free(c);
                 return -ENOMEM;
         }