summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGuillem Jover <guillem@hadrons.org>2013-06-08 17:55:19 +0200
committerGuillem Jover <guillem@hadrons.org>2013-06-08 18:09:36 +0200
commit50e4c55afddad7f1001c80f3682ea7400a808747 (patch)
tree0422b80772d04db3f11313843df32b13c4eeae99 /src
parent6faea4d2a0eb7782187dd6d92749a0813e7405bd (diff)
Try to check if setproctitle() constructor got passed arguments
Diffstat (limited to 'src')
-rw-r--r--src/setproctitle.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/setproctitle.c b/src/setproctitle.c
index 2137190..e4f648a 100644
--- a/src/setproctitle.c
+++ b/src/setproctitle.c
@@ -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;