]> Zhao Yanbai Git Server - minix.git/commitdiff
*** empty log message ***
authorJorrit Herder <jnherder@minix3.org>
Fri, 12 Aug 2005 12:13:11 +0000 (12:13 +0000)
committerJorrit Herder <jnherder@minix3.org>
Fri, 12 Aug 2005 12:13:11 +0000 (12:13 +0000)
commands/ibm/autopart.c

index c277ebf3b059bbc82deb9a6c063db89a1f9e4fb8..447958c7611019e8034e3aea0719852df4d6a38b 100755 (executable)
@@ -2307,6 +2307,11 @@ is_sure(int flags, char *fmt, ...)
        return !strncmp(yesno, "yes", 3);
 }
 
+void warn(char *message)
+{
+       printf("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b ! %s\n",message);
+}
+
 int
 may_kill_region(void)
 {
@@ -2491,9 +2496,12 @@ select_disk(void)
                        fflush(NULL);
                        if(!fgets(line, sizeof(line)-2, stdin))
                                exit(1);
-                       if(sscanf(line, "%d", &choice) != 1) continue;
+                       if(sscanf(line, "%d", &choice) != 1) {
+                               warn("choose a disk");
+                               continue;
+                       }
                        if(choice < 0 || choice >= i) {
-                               printf("\b\b\b\b\b\b\b\b\b\b\b\b\b ! out of range.\n");
+                               warn("out of range");
                                continue;
                        }
                        done = 1;