lib/fs: Fix format string in find_fs_mount()

A field width of 4096 allows fscanf() to store that amount of characters
into the given buffer, though that doesn't include the terminating NULL
byte. Decrease the value by one to leave space for it.

Signed-off-by: Phil Sutter <phil@nwl.cc>
This commit is contained in:
Phil Sutter 2017-08-24 11:51:46 +02:00 committed by Stephen Hemminger
parent 45c2ec9e95
commit eab4507898
1 changed files with 1 additions and 1 deletions

View File

@ -45,7 +45,7 @@ static char *find_fs_mount(const char *fs_to_find)
return NULL;
}
while (fscanf(fp, "%*s %4096s %127s %*s %*d %*d\n",
while (fscanf(fp, "%*s %4095s %127s %*s %*d %*d\n",
path, fstype) == 2) {
if (strcmp(fstype, fs_to_find) == 0) {
mnt = strdup(path);