summaryrefslogtreecommitdiff
path: root/loginutils
diff options
context:
space:
mode:
Diffstat (limited to 'loginutils')
-rw-r--r--loginutils/getty.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/loginutils/getty.c b/loginutils/getty.c
index bc735d0..d32d189 100644
--- a/loginutils/getty.c
+++ b/loginutils/getty.c
@@ -166,8 +166,10 @@ static void parse_speeds(struct options *op, char *arg)
debug("entered parse_speeds\n");
for (cp = strtok(arg, ","); cp != 0; cp = strtok((char *) 0, ",")) {
- if ((op->speeds[op->numspeed++] = bcode(cp)) <= 0)
+ op->speeds[op->numspeed] = bcode(cp);
+ if (op->speeds[op->numspeed] <= 0)
bb_error_msg_and_die("bad speed: %s", cp);
+ op->numspeed++;
if (op->numspeed > MAX_SPEED)
bb_error_msg_and_die("too many alternate speeds");
}