X-Git-Url: https://git.wh0rd.org/?p=dump.git;a=blobdiff_plain;f=dump%2Foptr.c;h=fdda1c4e594ef67297377982731e2ec7eeff4cec;hp=8287df5dcaf24c5e827f202d51816bf31e80afc4;hb=a2c9bd286cf061b9c6e6565474c1af77e8cf2d1e;hpb=7c6b27d3f3dcb57fd3d318dd6e4af05f222d15c5 diff --git a/dump/optr.c b/dump/optr.c index 8287df5..fdda1c4 100644 --- a/dump/optr.c +++ b/dump/optr.c @@ -40,7 +40,7 @@ #ifndef lint static const char rcsid[] = - "$Id: optr.c,v 1.8 2000/01/21 10:17:41 stelian Exp $"; + "$Id: optr.c,v 1.9 2000/01/26 11:38:08 stelian Exp $"; #endif /* not lint */ #include @@ -427,8 +427,11 @@ allocfsent(struct fstab *fs) register struct fstab *new; new = (struct fstab *)malloc(sizeof (*fs)); - if (new == NULL || - (new->fs_file = strdup(fs->fs_file)) == NULL || + if (new == NULL) + quit("%s\n", strerror(errno)); + if (strlen(fs->fs_file) > 1 && fs->fs_file[strlen(fs->fs_file) - 1] == '/') + fs->fs_file[strlen(fs->fs_file) - 1] = '\0'; + if ((new->fs_file = strdup(fs->fs_file)) == NULL || (new->fs_type = strdup(fs->fs_type)) == NULL || (new->fs_spec = strdup(fs->fs_spec)) == NULL) quit("%s\n", strerror(errno));