diff --git a/mkpasswd.c b/mkpasswd.c index 5820f32..d7c31a1 100644 --- a/mkpasswd.c +++ b/mkpasswd.c @@ -179,11 +179,14 @@ int main(int argc, char *argv[]) case 'R': { char *p; - rounds = strtol(optarg, &p, 10); - if (p == NULL || *p != '\0' || rounds < 0) { + long r; + + r = strtol(optarg, &p, 10); + if (p == NULL || *p != '\0' || r < 0) { fprintf(stderr, _("Invalid number '%s'.\n"), optarg); exit(1); } + rounds = r; } break; case 's':