summaryrefslogtreecommitdiffstats
path: root/sbin/disklabel/editor.c
diff options
context:
space:
mode:
authorcnst <cnst@openbsd.org>2008-12-07 01:11:50 +0000
committercnst <cnst@openbsd.org>2008-12-07 01:11:50 +0000
commite97229a364dc6da221d9886fb6a714922d206872 (patch)
tree550e37301acc47d4282b5a75e175aa341d6af7d1 /sbin/disklabel/editor.c
parentDon't check / reset s->s_msg.datafp where its state is obviously known. (diff)
downloadwireguard-openbsd-e97229a364dc6da221d9886fb6a714922d206872.tar.xz
wireguard-openbsd-e97229a364dc6da221d9886fb6a714922d206872.zip
fix an 11-year-old typo in an if statement; 'null dereference' llvm/clang; ok millert
Diffstat (limited to 'sbin/disklabel/editor.c')
-rw-r--r--sbin/disklabel/editor.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c
index f8a5666d69e..08901c4c922 100644
--- a/sbin/disklabel/editor.c
+++ b/sbin/disklabel/editor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: editor.c,v 1.171 2008/09/03 11:13:54 jsg Exp $ */
+/* $OpenBSD: editor.c,v 1.172 2008/12/07 01:11:50 cnst 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.171 2008/09/03 11:13:54 jsg Exp $";
+static char rcsid[] = "$OpenBSD: editor.c,v 1.172 2008/12/07 01:11:50 cnst Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -366,7 +366,7 @@ editor(struct disklabel *lp, int f, char *dev, char *fstabfile)
arg = getstring("Filename",
"Name of the file to save label into.",
NULL);
- if (arg == NULL && *arg == '\0')
+ if (arg == NULL || *arg == '\0')
break;
}
if ((fp = fopen(arg, "w")) == NULL) {