]> git.ipfire.org Git - thirdparty/libbsd.git/commitdiff
Try to check if setproctitle() constructor got passed arguments
authorGuillem Jover <guillem@hadrons.org>
Sat, 8 Jun 2013 15:55:19 +0000 (17:55 +0200)
committerGuillem Jover <guillem@hadrons.org>
Sat, 8 Jun 2013 16:09:36 +0000 (18:09 +0200)
src/setproctitle.c

index 2137190b6023cc8733da7d1638efbae4564d31c3..e4f648a3c799e73a6321ffd60be275bbb0e4e160 100644 (file)
@@ -135,6 +135,10 @@ spt_init(int argc, char *argv[], char *envp[])
        char *base, *end, *nul, *tmp;
        int i, error;
 
+       /* Try to make sure we got called with main() arguments. */
+       if (argc < 0)
+               return;
+
        base = argv[0];
        if (base == NULL)
                return;