diff options
author | Marcus Brinkmann <marcus@gnu.org> | 2001-02-18 21:14:35 +0000 |
---|---|---|
committer | Marcus Brinkmann <marcus@gnu.org> | 2001-02-18 21:14:35 +0000 |
commit | 454621620efad6f44ff2fd0e0220033baf15ef5f (patch) | |
tree | 97ed2b7dde182fb1f4cc92091ba1191660e4814c /sutils | |
parent | 646ac529c3d679f49f7866ffd65dbd94c3a500a3 (diff) |
2001-02-18 Marcus Brinkmann <marcus@gnu.org>
* fstab.c (STORE): Only copy when field exists (is non-zero).
Reported by Alexey Dejeka <alexey@comail.ru>.
Diffstat (limited to 'sutils')
-rw-r--r-- | sutils/ChangeLog | 5 | ||||
-rw-r--r-- | sutils/fstab.c | 8 |
2 files changed, 12 insertions, 1 deletions
diff --git a/sutils/ChangeLog b/sutils/ChangeLog index 79c35f32..c07577c2 100644 --- a/sutils/ChangeLog +++ b/sutils/ChangeLog @@ -1,3 +1,8 @@ +2001-02-18 Marcus Brinkmann <marcus@gnu.org> + + * fstab.c (STORE): Only copy when field exists (is non-zero). + Reported by Alexey Dejeka <alexey@comail.ru>. + 2001-01-14 Marcus Brinkmann <marcus@gnu.org> * MAKEDEV.sh (mkdev: klog): New device, using /hurd/streamio kmsg. diff --git a/sutils/fstab.c b/sutils/fstab.c index 4574d41d..e40572e2 100644 --- a/sutils/fstab.c +++ b/sutils/fstab.c @@ -275,7 +275,13 @@ fs_set_mntent (struct fs *fs, const struct mntent *mntent) /* Copy each mntent field from MNTENT into FS's version. */ end = fs->storage; #define STORE(field) \ - fs->mntent.field = end; end = stpcpy (end, mntent->field) + 1 + if (mntent->field) \ + { \ + fs->mntent.field = end; \ + end = stpcpy (end, mntent->field) + 1; \ + } \ + else \ + fs->mntent.field = 0; STORE (mnt_fsname); STORE (mnt_dir); STORE (mnt_type); |