summaryrefslogtreecommitdiffstats
path: root/sbin/disklabel/editor.c
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2009-04-11 23:57:56 +0000
committerkrw <krw@openbsd.org>2009-04-11 23:57:56 +0000
commitd9f9fadd94356fd294110db7cf1561a5068ac06a (patch)
treeb85d88680b45814bc01a31c5f4adb6b6a5db8556 /sbin/disklabel/editor.c
parentAvoid dereferencing a null pointer when pf attempts to translate a (diff)
downloadwireguard-openbsd-d9f9fadd94356fd294110db7cf1561a5068ac06a.tar.xz
wireguard-openbsd-d9f9fadd94356fd294110db7cf1561a5068ac06a.zip
Always display any mountpoint info available. Thus a simple -A will
now show the planned mountpoint layout. ok deraadt@
Diffstat (limited to 'sbin/disklabel/editor.c')
-rw-r--r--sbin/disklabel/editor.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c
index 02378a6ece1..48fbc431569 100644
--- a/sbin/disklabel/editor.c
+++ b/sbin/disklabel/editor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: editor.c,v 1.189 2009/04/11 15:17:11 krw Exp $ */
+/* $OpenBSD: editor.c,v 1.190 2009/04/11 23:57:56 krw Exp $ */
/*
* Copyright (c) 1997-2000 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -17,7 +17,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: editor.c,v 1.189 2009/04/11 15:17:11 krw Exp $";
+static char rcsid[] = "$OpenBSD: editor.c,v 1.190 2009/04/11 23:57:56 krw Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -501,8 +501,7 @@ editor_allocspace(struct disklabel *lp)
if (j == MAXPARTITIONS)
return;
pp = &lp->d_partitions[j];
- if (fstabfile)
- partmp = &mountpoints[j];
+ partmp = &mountpoints[j];
ap = &alloc[i];
/* Figure out the size of the partition. */
@@ -568,11 +567,9 @@ editor_allocspace(struct disklabel *lp)
pp->p_fstype = FS_SWAP;
else {
pp->p_fstype = FS_BSDFFS;
- if (fstabfile) {
- free(*partmp);
- if ((*partmp = strdup(ap->mp)) == NULL)
- errx(4, "out of memory");
- }
+ free(*partmp);
+ if ((*partmp = strdup(ap->mp)) == NULL)
+ errx(4, "out of memory");
}
}