diff options
author | Alexander Hall <halex@cvs.openbsd.org> | 2010-07-04 22:15:32 +0000 |
---|---|---|
committer | Alexander Hall <halex@cvs.openbsd.org> | 2010-07-04 22:15:32 +0000 |
commit | f41036d77976f6b2e25a0997c6fa54e36ac51c09 (patch) | |
tree | e10e6edc039b63a77777219016ffcad8d9123efd /sbin | |
parent | bbaf2117e0856de79ac25e5fc57b71770e9d0b0c (diff) |
make ^D handling consistant in fdisk by just bailing out instead of
returning a magic value that is not even handled as such by the caller
ok krw@
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/fdisk/misc.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/sbin/fdisk/misc.c b/sbin/fdisk/misc.c index 42420439c48..7ee1d812864 100644 --- a/sbin/fdisk/misc.c +++ b/sbin/fdisk/misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: misc.c,v 1.22 2009/07/24 23:28:00 halex Exp $ */ +/* $OpenBSD: misc.c,v 1.23 2010/07/04 22:15:31 halex Exp $ */ /* * Copyright (c) 1997 Tobias Weingartner @@ -220,14 +220,8 @@ getuint(disk_t *disk, char *prompt, char *helpstring, u_int32_t oval, buf[0] = '\0'; do { printf("%s: [%u] ", prompt, oval); - if (fgets(buf, sizeof(buf), stdin) == NULL) { - buf[0] = '\0'; - if (feof(stdin)) { - clearerr(stdin); - putchar('\n'); - return(UINT_MAX - 1); - } - } + if (fgets(buf, sizeof(buf), stdin) == NULL) + errx(1, "eof"); n = strlen(buf); if (n > 0 && buf[n-1] == '\n') buf[--n] = '\0'; |