]> Dogcows Code - chaz/openbox/commitdiff
Pass NULL, not 0, handle invalid --id better.
authorMikael Magnusson <mikachu@gmail.com>
Fri, 8 Jan 2010 20:51:35 +0000 (21:51 +0100)
committerMikael Magnusson <mikachu@gmail.com>
Fri, 8 Jan 2010 20:51:35 +0000 (21:51 +0100)
tools/obxprop/obxprop.c

index b28b77a7c13ce931bd7ce0dedad9620c03814240..2e6b2a03f7e84903ea8212e9853816f884ea9bae 100644 (file)
@@ -273,13 +273,13 @@ int main(int argc, char **argv)
 
     for (i = 1; i < argc; ++i) {
         if (!strcmp(argv[i], "--help")) {
-            return fail(0);
+            return fail(NULL);
         }
         else if (!strcmp(argv[i], "--root"))
             root = TRUE;
         else if (!strcmp(argv[i], "--id")) {
             if (++i == argc)
-                return fail(0);
+                return fail(NULL);
             if (argv[i][0] == '0' && argv[i][1] == 'x') {
                 /* hex */
                 userid = parse_hex(argv[i]+2);
@@ -288,11 +288,12 @@ int main(int argc, char **argv)
                 /* decimal */
                 userid = atoi(argv[i]);
             }
-            break;
+            if (!userid)
+                return fail("Unable to parse argument to --id.");
         }
         else if (!strcmp(argv[i], "--display")) {
             if (++i == argc)
-                return fail(0);
+                return fail(NULL);
             dname = argv[i];
         }
         else if (*argv[i] != '-')
This page took 0.02291 seconds and 4 git commands to generate.