summaryrefslogtreecommitdiff
path: root/loginutils
diff options
context:
space:
mode:
authorDenys Vlasenko2009-10-23 03:16:08 +0200
committerDenys Vlasenko2009-10-23 03:16:08 +0200
commitf2cbb03a378aa48f2e08b64877d54da3fab4ea6a (patch)
tree35ff7449ba394e4e0a84a19a70eafa7b181d8d71 /loginutils
parent7b4cd6f7b07b816c4b36d686fe47c5cfec7f5abf (diff)
downloadbusybox-f2cbb03a378aa48f2e08b64877d54da3fab4ea6a.zip
busybox-f2cbb03a378aa48f2e08b64877d54da3fab4ea6a.tar.gz
*: optimize most of isXXXXX() macros
text data bss dec hex filename 824164 453 6812 831429 cafc5 busybox_old 823730 453 6812 830995 cae13 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'loginutils')
-rw-r--r--loginutils/login.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/loginutils/login.c b/loginutils/login.c
index ed2ab7f..70e8562 100644
--- a/loginutils/login.c
+++ b/loginutils/login.c
@@ -225,19 +225,22 @@ static void get_username_or_die(char *buf, int size_buf)
/* skip whitespace */
do {
c = getchar();
- if (c == EOF) exit(EXIT_FAILURE);
+ if (c == EOF)
+ exit(EXIT_FAILURE);
if (c == '\n') {
- if (!--cntdown) exit(EXIT_FAILURE);
+ if (!--cntdown)
+ exit(EXIT_FAILURE);
goto prompt;
}
- } while (isspace(c));
+ } while (isspace(c)); /* maybe isblank? */
*buf++ = c;
if (!fgets(buf, size_buf-2, stdin))
exit(EXIT_FAILURE);
if (!strchr(buf, '\n'))
exit(EXIT_FAILURE);
- while (isgraph(*buf)) buf++;
+ while ((unsigned char)*buf > ' ')
+ buf++;
*buf = '\0';
}