mirror of
https://github.com/troglobit/finit.git
synced 2026-11-08 16:11:10 +00:00
getfsent(): Read only six fields per line
The fs.fs_type is only for *BSD, we hard-code it to "rw" in the meantime. Should be safe in most cases. Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
d76ecad517
commit
1a8f1d9604
1 file changed
+6
-3
@@ -274,12 +274,15 @@ struct fstab *getfsent(void)
|
|||||||
static struct fstab fs;
|
static struct fstab fs;
|
||||||
|
|
||||||
fs.fs_spec = lftok(fstab);
|
fs.fs_spec = lftok(fstab);
|
||||||
|
if (fs.fs_spec == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
fs.fs_file = lftok(fstab);
|
fs.fs_file = lftok(fstab);
|
||||||
fs.fs_vfstype = lftok(fstab);
|
fs.fs_vfstype = lftok(fstab);
|
||||||
fs.fs_mntops = lftok(fstab);
|
fs.fs_mntops = lftok(fstab);
|
||||||
fs.fs_type = (const char *)lftok(fstab);
|
fs.fs_type = "rw";
|
||||||
fs.fs_freq = atoi(lftok(fstab) ?: 0);
|
fs.fs_freq = atoi(lftok(fstab) ?: "0");
|
||||||
fs.fs_passno = atoi(lftok(fstab) ?: 0);
|
fs.fs_passno = atoi(lftok(fstab) ?: "0");
|
||||||
|
|
||||||
return &fs;
|
return &fs;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user