diff options
Diffstat (limited to 'src/rc/start-stop-daemon.c')
-rw-r--r-- | src/rc/start-stop-daemon.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rc/start-stop-daemon.c b/src/rc/start-stop-daemon.c index 8237e1e8..1952154a 100644 --- a/src/rc/start-stop-daemon.c +++ b/src/rc/start-stop-daemon.c @@ -960,9 +960,9 @@ start_stop_daemon(int argc, char **argv) if (interpreted && !pidfile) { fp = fopen(exec_file, "r"); if (fp) { - fgets(line, sizeof(line), fp); + p = fgets(line, sizeof(line), fp); fclose(fp); - if (line[0] == '#' && line[1] == '!') { + if (p != NULL && line[0] == '#' && line[1] == '!') { p = line + 2; /* Strip leading spaces */ while (*p == ' ' || *p == '\t') |