diff options
author | Alexander Hall <halex@cvs.openbsd.org> | 2010-06-30 21:11:21 +0000 |
---|---|---|
committer | Alexander Hall <halex@cvs.openbsd.org> | 2010-06-30 21:11:21 +0000 |
commit | daa4e8e4395bdf7b5d767fe6cd221d027b79b999 (patch) | |
tree | 2fbe4cebc66047bf86905a68129f50d34713ca2f /sbin/disklabel/editor.c | |
parent | 458a13be62a11cb3845bf20e405aebb2eea74343 (diff) |
make the disklabel editor not crash when pressing ^D in the uid prompt
ok krw@
Diffstat (limited to 'sbin/disklabel/editor.c')
-rw-r--r-- | sbin/disklabel/editor.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c index 996c1bbbf84..310bd934bc1 100644 --- a/sbin/disklabel/editor.c +++ b/sbin/disklabel/editor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: editor.c,v 1.239 2010/05/18 04:41:14 dlg Exp $ */ +/* $OpenBSD: editor.c,v 1.240 2010/06/30 21:11:20 halex Exp $ */ /* * Copyright (c) 1997-2000 Todd C. Miller <Todd.Miller@courtesan.com> @@ -1618,7 +1618,7 @@ set_uid(struct disklabel *lp) do { s = getstring("uid", "The disklabel UID, given as a 16 " "character hexadecimal string.", NULL); - if (strlen(s) == 0) { + if (s == NULL || strlen(s) == 0) { fputs("Command aborted\n", stderr); return; } |