aboutsummaryrefslogtreecommitdiff
path: root/pwgen.c
diff options
context:
space:
mode:
Diffstat (limited to 'pwgen.c')
-rw-r--r--pwgen.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/pwgen.c b/pwgen.c
index 3af933b..a371f92 100644
--- a/pwgen.c
+++ b/pwgen.c
@@ -158,6 +158,10 @@ int main(int argc, char **argv)
pw_length = strtol(argv[optind], &tmp, 0);
if (pw_length < 5)
pwgen = pw_rand;
+ if (pw_length <= 2)
+ pwgen_flags &= ~PW_UPPERS;
+ if (pw_length <= 1)
+ pwgen_flags &= ~PW_DIGITS;
if (*tmp) {
fprintf(stderr, "Invalid password length: %s\n",
argv[optind]);