diff options
author | Ray Lai <ray@cvs.openbsd.org> | 2007-02-24 03:30:12 +0000 |
---|---|---|
committer | Ray Lai <ray@cvs.openbsd.org> | 2007-02-24 03:30:12 +0000 |
commit | 77e062d611a450d5bdc56a9c33d1d9cd1c219dc8 (patch) | |
tree | a09d498f0af634e2f7510045214397956175629f | |
parent | 9154c070f95b963fe8857b73fcb8d54c8844d47b (diff) |
- strlen returns size_t, not int.
- Pass full buffer size to fgets.
OK djm@, millert@, and moritz@.
-rw-r--r-- | usr.bin/ssh/moduli.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/usr.bin/ssh/moduli.c b/usr.bin/ssh/moduli.c index 3176fae2a47..d7119a7b8d9 100644 --- a/usr.bin/ssh/moduli.c +++ b/usr.bin/ssh/moduli.c @@ -1,4 +1,4 @@ -/* $OpenBSD: moduli.c,v 1.19 2006/11/06 21:25:28 markus Exp $ */ +/* $OpenBSD: moduli.c,v 1.20 2007/02/24 03:30:11 ray Exp $ */ /* * Copyright 1994 Phil Karn <karn@qualcomm.com> * Copyright 1996-1998, 2003 William Allen Simpson <wsimpson@greendragon.com> @@ -488,11 +488,9 @@ prime_test(FILE *in, FILE *out, u_int32_t trials, u_int32_t generator_wanted) res = 0; lp = xmalloc(QLINESIZE + 1); - while (fgets(lp, QLINESIZE, in) != NULL) { - int ll = strlen(lp); - + while (fgets(lp, QLINESIZE + 1, in) != NULL) { count_in++; - if (ll < 14 || *lp == '!' || *lp == '#') { + if (strlen(lp) < 14 || *lp == '!' || *lp == '#') { debug2("%10u: comment or short line", count_in); continue; } |