]>
Commit | Line | Data |
---|---|---|
0d468d13 JR |
1 | Index: pam/modules/pam_pwgen/pam_pwgen_app.c |
2 | =================================================================== | |
3 | RCS file: /cvsroot/pam/modules/pam_pwgen/pam_pwgen_app.c,v | |
4 | retrieving revision 1.3 | |
518e361b JR |
5 | retrieving revision 1.5 |
6 | diff -u -r1.3 -r1.5 | |
0d468d13 | 7 | --- pam/modules/pam_pwgen/pam_pwgen_app.c 14 May 2004 12:40:15 -0000 1.3 |
518e361b JR |
8 | +++ pam/modules/pam_pwgen/pam_pwgen_app.c 20 Feb 2006 15:33:58 -0000 1.5 |
9 | @@ -322,35 +322,36 @@ | |
10 | int genpw; | |
11 | struct tris_data *tr; | |
12 | struct stat st; | |
99290a7a | 13 | + char **av; |
518e361b | 14 | |
0d468d13 JR |
15 | strcpy(tri_file, DEFAULT_TRIGRAM_FILE); |
16 | ||
17 | /* step through arguments */ | |
18 | - for (; argc-- > 1; ++argv) { | |
99290a7a | 19 | + for (av=argv+1; *av; av++) { |
0d468d13 JR |
20 | char *ep = NULL; |
21 | ||
22 | /* generic options */ | |
518e361b JR |
23 | |
24 | - if (!strncmp(*argv, "minlen=", 7)) { | |
25 | - min_length = strtol(*argv + 7, &ep, 10); | |
26 | + if (!strncmp(*av, "minlen=", 7)) { | |
27 | + min_length = strtol(*av + 7, &ep, 10); | |
28 | if (!ep || (min_length < 5)) | |
29 | min_length = 5; | |
30 | if (min_length > 64) | |
31 | min_length = 64; | |
32 | - } else if (!strncmp(*argv, "count=", 6)) { | |
33 | - pw_count = strtol(*argv + 6, &ep, 10); | |
34 | + } else if (!strncmp(*av, "count=", 6)) { | |
35 | + pw_count = strtol(*av + 6, &ep, 10); | |
36 | if (!ep || (pw_count < 5)) | |
37 | pw_count = 5; | |
38 | if (pw_count > 100) | |
39 | pw_count = 100; | |
40 | - } else if (!strncmp(*argv, "trifile=", 7)) { | |
41 | - strncpy(tri_file, *argv + 7, 128); | |
42 | - } else if (!strncmp(*argv, "upper=", 6)) { | |
43 | - upper = strtol(*argv + 6, &ep, 10); | |
0c8f7b8b JR |
44 | + } else if (!strncmp(*av, "trifile=", 8)) { |
45 | + strncpy(tri_file, *av + 8, 128); | |
518e361b JR |
46 | + } else if (!strncmp(*av, "upper=", 6)) { |
47 | + upper = strtol(*av + 6, &ep, 10); | |
48 | if (!ep || (upper < 0)) | |
49 | upper = 0; | |
50 | - } else if (!strncmp(*argv, "digit=", 6)) { | |
51 | - digit = strtol(*argv + 6, &ep, 10); | |
52 | + } else if (!strncmp(*av, "digit=", 6)) { | |
53 | + digit = strtol(*av + 6, &ep, 10); | |
54 | if (!ep || (digit < 0)) | |
55 | digit = 0; | |
56 | } else { |