summaryrefslogtreecommitdiff
path: root/e2fsprogs/fsck.c
diff options
context:
space:
mode:
Diffstat (limited to 'e2fsprogs/fsck.c')
-rw-r--r--e2fsprogs/fsck.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/e2fsprogs/fsck.c b/e2fsprogs/fsck.c
index f80de81..8dd9785 100644
--- a/e2fsprogs/fsck.c
+++ b/e2fsprogs/fsck.c
@@ -349,9 +349,7 @@ static int parse_fstab_line(char *line, struct fs_info **ret_fs)
*ret_fs = 0;
strip_line(line);
- cp = strchr(line, '#');
- if (cp)
- *cp = '\0'; /* Ignore everything after the comment char */
+ *strchrnul(line, '#') = '\0'; /* Ignore everything after comment */
cp = line;
device = parse_word(&cp);