From d20bc45ccd2a71c3901f8ba67888307962d6e702 Mon Sep 17 00:00:00 2001 From: Zygmunt Krynicki Date: Thu, 8 Sep 2016 13:05:05 +0200 Subject: [PATCH] Comment that optional_fields is never NULL Signed-off-by: Zygmunt Krynicki --- src/mountinfo.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mountinfo.c b/src/mountinfo.c index 82d042e..686a40d 100644 --- a/src/mountinfo.c +++ b/src/mountinfo.c @@ -235,6 +235,7 @@ static struct mountinfo_entry *parse_mountinfo_entry(const char *line) if ((entry->mount_opts = parse_next_string_field()) == NULL) goto fail; entry->optional_fields = &entry->line_buf[0] + total_used++; + // NOTE: This ensure s that optional_fields is never NULL. strcpy(entry->optional_fields, ""); for (;;) { char *opt_field = parse_next_string_field();