aboutsummaryrefslogtreecommitdiff
path: root/libexec/getty/main.c
diff options
context:
space:
mode:
authorYaroslav Tykhiy <ytykhiy@gmail.com>2003-06-10 15:38:35 +0000
committerYaroslav Tykhiy <ytykhiy@gmail.com>2003-06-10 15:38:35 +0000
commit8b52276d101bd9642e7f485ca68b2126b77e6f60 (patch)
tree421be5bd53008e3329bd392fddb9260b8d11a58b /libexec/getty/main.c
parent018319c22687313fb50407421f8eecb2b3017cc6 (diff)
downloadsrc-8b52276d101bd9642e7f485ca68b2126b77e6f60.tar.gz
src-8b52276d101bd9642e7f485ca68b2126b77e6f60.zip
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.
Notes
Notes: svn path=/head/; revision=116154
Diffstat (limited to 'libexec/getty/main.c')
-rw-r--r--libexec/getty/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libexec/getty/main.c b/libexec/getty/main.c
index 5410ef7c4195..0bb4f5ed2d79 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;