diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-03-17 02:20:18 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-03-17 02:20:18 +0000 |
commit | beb3cc466e92fc53de1f47d444a5330e87440998 (patch) | |
tree | 113c2cbbcceebb47e3c473ff0da16e8838c65f0a /libexec | |
parent | 85d7e8a1ed7c7dedc4e0ff3e6f1eb24f0b7357d9 (diff) |
incorrect string length matching; ianm@cit.uws.edu.au
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/login_passwd/login.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libexec/login_passwd/login.c b/libexec/login_passwd/login.c index 618807caee7..3ce5acde35d 100644 --- a/libexec/login_passwd/login.c +++ b/libexec/login_passwd/login.c @@ -1,4 +1,4 @@ -/* $OpenBSD: login.c,v 1.5 2002/09/06 18:45:06 deraadt Exp $ */ +/* $OpenBSD: login.c,v 1.6 2003/03/17 02:20:17 deraadt Exp $ */ /*- * Copyright (c) 1995 Berkeley Software Design, Inc. All rights reserved. @@ -70,12 +70,12 @@ main(int argc, char **argv) syslog(LOG_ERR, "%s: invalid service", optarg); exit(1); } - break; + break; case 'v': - if (strncmp(optarg, "wheel=", 6) == 0) - wheel = optarg + 6; - else if (strncmp(optarg, "lastchance=", 10) == 0) - lastchance = (strcmp(optarg + 10, "yes") == 0); + if (strncmp(optarg, "wheel=", 6) == 0) + wheel = optarg + 6; + else if (strncmp(optarg, "lastchance=", 11) == 0) + lastchance = (strcmp(optarg + 11, "yes") == 0); else if (strcmp(optarg, "login=yes") == 0) arg_login = 1; else if (strcmp(optarg, "notickets=yes") == 0) @@ -119,7 +119,7 @@ main(int argc, char **argv) mode = 0; count = -1; while (++count < sizeof(response) && - read(3, &response[count], 1) == 1) { + read(3, &response[count], 1) == 1) { if (response[count] == '\0' && ++mode == 2) break; if (response[count] == '\0' && mode == 1) { |