From 151ea28b4aa3f763472cbb41fe8b335a0ed60ecc Mon Sep 17 00:00:00 2001 From: yar Date: Tue, 10 Jun 2003 15:38:35 +0000 Subject: Coding style fix: Use "foo = 1" instead of "foo++" to assign the truth value to a boolean variable, especially when inside a loop. The variable can overflow otherwise, at least in theory. --- libexec/getty/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libexec') diff --git a/libexec/getty/main.c b/libexec/getty/main.c index 5410ef7..0bb4f5e 100644 --- a/libexec/getty/main.c +++ b/libexec/getty/main.c @@ -356,7 +356,7 @@ main(int argc, char *argv[]) else if (islower(*p)) lower = 1; else if (isdigit(*p)) - digit++; + digit = 1; *q++ = *p++; } } else if (!(PL && PP)) @@ -604,7 +604,7 @@ getname(void) np = name; continue; } else if (isdigit(c)) - digit++; + digit = 1; if (IG && (c <= ' ' || c > 0176)) continue; *np++ = c; -- cgit v1.1