]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: use const char in mountinfo parser
authorKarel Zak <kzak@redhat.com>
Fri, 20 Jul 2018 11:44:53 +0000 (13:44 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 20 Jul 2018 11:48:09 +0000 (13:48 +0200)
The parser does not modify the string, so let's keep it "const char".

Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/tab_parse.c

index 316aee7f63fb25fc7f7e94f3a022c2426cd14c54..da1f2a5b0960abe3dd13b2bbe410203c8f0efe1b 100644 (file)
@@ -146,11 +146,12 @@ static int mnt_parse_table_line(struct libmnt_fs *fs, const char *s)
 /*
  * Parses one line from a mountinfo file
  */
-static int mnt_parse_mountinfo_line(struct libmnt_fs *fs, char *s)
+static int mnt_parse_mountinfo_line(struct libmnt_fs *fs, const char *s)
 {
        int rc, end = 0;
        unsigned int maj, min;
-       char *fstype = NULL, *src = NULL, *p;
+       char *fstype = NULL, *src = NULL;
+       const char *p;
 
        rc = sscanf(s,  "%d "           /* (1) id */
                        "%d "           /* (2) parent */