diff options
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/cron/lib/misc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/cron/lib/misc.c b/usr.sbin/cron/lib/misc.c index f8538ea..195ff9c 100644 --- a/usr.sbin/cron/lib/misc.c +++ b/usr.sbin/cron/lib/misc.c @@ -392,7 +392,8 @@ in_file(string, file) rewind(file); while (fgets(line, MAX_TEMPSTR, file)) { if (line[0] != '\0') - line[strlen(line)-1] = '\0'; + if (line[strlen(line)-1] == '\n') + line[strlen(line)-1] = '\0'; if (0 == strcmp(line, string)) return TRUE; } |