Hi Alexy,
sorry for getting back to you so late.
Can you explain in one or two sentences, under which conditions which
of the mntent fields are zero when this function is called? The C library
will always return the empty string instead of NULL, so I wonder if the
patch is correct, or if the bug is probably in the caller.
The macro is not entirely safe. To make it safer, it should be enclosed in
a block. Also, the semicolon can go then. But don't worry about that, I will
do it when this is the right place to fix it.
Thanks,
Marcus
On Wed, Dec 13, 2000 at 10:44:39PM +0300, Alexey Dejneka wrote:
> $ mount -t isofs /dev/hd2 /cdrom
> gives segmentation fault.
> Patch:
> ---cut here---
> diff -ur hurd/sutils/fstab.c hurd-new/sutils/fstab.c
> --- hurd/sutils/fstab.c Fri Nov 19 08:06:18 1999
> +++ hurd-new/sutils/fstab.c Wed Dec 13 11:06:03 2000
> @@ -275,7 +275,12 @@
> /* 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; *end++ = 0;\
> + }
> STORE (mnt_fsname);
> STORE (mnt_dir);
> STORE (mnt_type);
> ---cut here---
>
> _______________________________________________
> Bug-hurd mailing list
> [EMAIL PROTECTED]
> http://mail.gnu.org/mailman/listinfo/bug-hurd
>
--
`Rhubarb is no Egyptian god.' Debian http://www.debian.org [EMAIL PROTECTED]
Marcus Brinkmann GNU http://www.gnu.org [EMAIL PROTECTED]
[EMAIL PROTECTED]
http://www.marcus-brinkmann.de
_______________________________________________
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd