]> code.citadel.org Git - citadel.git/commitdiff
* Added "keymenu()" generic menu-maker to commands.c
authorArt Cancro <ajc@citadel.org>
Sun, 27 Feb 2000 04:55:51 +0000 (04:55 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 27 Feb 2000 04:55:51 +0000 (04:55 +0000)
* Blocked non-numeric input to intprompt()  (fixes bug #16)

citadel/ChangeLog
citadel/commands.c

index 208df46ed7cce10533b672f79204344be19491ec..85713aa773def92ea0db19828ce2ca298d0fc866 100644 (file)
@@ -1,4 +1,8 @@
 $Log$
+Revision 1.473  2000/02/27 04:55:51  ajc
+* Added "keymenu()" generic menu-maker to commands.c
+* Blocked non-numeric input to intprompt()  (fixes bug #16)
+
 Revision 1.472  2000/02/27 03:57:35  ajc
 * Completed 'fsck'-like reference count verifier (server and client)
 
@@ -1675,3 +1679,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * Initial CVS import 
+
index 1ab8c15b7d9f9bc9a26e64a6349f41550c2a4bbd..4a69b1aecc97ec0b1cc777518d8ce393ff820237 100644 (file)
@@ -351,11 +351,16 @@ int intprompt(char *prompt, int ival, int imin, int imax)
 {
        char buf[16];
        int i;
-       i = ival;
+       int p;
+
        do {
+               i = ival;
                snprintf(buf, sizeof buf, "%d", i);
                strprompt(prompt, buf, 15);
                i = atoi(buf);
+               for (p=0; p<strlen(buf); ++p) {
+                       if (!isdigit(buf[p])) i = imin - 1;
+               }
                if (i < imin)
                        printf("*** Must be no less than %d.\n", imin);
                if (i > imax)