summaryrefslogtreecommitdiffstats
path: root/disk-utils/fdisk.c
diff options
context:
space:
mode:
Diffstat (limited to 'disk-utils/fdisk.c')
-rw-r--r--disk-utils/fdisk.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/disk-utils/fdisk.c b/disk-utils/fdisk.c
index 8807940ec..8a0bfd575 100644
--- a/disk-utils/fdisk.c
+++ b/disk-utils/fdisk.c
@@ -107,7 +107,7 @@ static int ask_menu(struct fdisk_context *cxt, struct fdisk_ask *ask,
do {
char prompt[128];
- int key, c;
+ int key, c, rc;
const char *name, *desc;
size_t i = 0;
@@ -117,7 +117,9 @@ static int ask_menu(struct fdisk_context *cxt, struct fdisk_ask *ask,
/* ask for key */
snprintf(prompt, sizeof(prompt), _("Select (default %c): "), dft);
- get_user_reply(cxt, prompt, buf, bufsz);
+ rc = get_user_reply(cxt, prompt, buf, bufsz);
+ if (rc)
+ return rc;
if (!*buf) {
fdisk_info(cxt, _("Using default response %c."), dft);
c = dft;