=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/encrypt/encrypt.c,v retrieving revision 1.26 retrieving revision 1.27 diff -c -r1.26 -r1.27 *** src/usr.bin/encrypt/encrypt.c 2007/03/20 03:50:39 1.26 --- src/usr.bin/encrypt/encrypt.c 2007/05/01 01:26:25 1.27 *************** *** 1,4 **** ! /* $OpenBSD: encrypt.c,v 1.26 2007/03/20 03:50:39 tedu Exp $ */ /* * Copyright (c) 1996, Jason Downs. All rights reserved. --- 1,4 ---- ! /* $OpenBSD: encrypt.c,v 1.27 2007/05/01 01:26:25 jdixon Exp $ */ /* * Copyright (c) 1996, Jason Downs. All rights reserved. *************** *** 35,40 **** --- 35,41 ---- #include #include #include + #include /* * Very simple little program, for encrypting passwords from the command *************** *** 144,149 **** --- 145,151 ---- int prompt = 0; int rounds; void *extra = NULL; /* Store salt or number of rounds */ + const char *errstr; if (strcmp(__progname, "makekey") == 0) operation = DO_MAKEKEY; *************** *** 179,185 **** if (operation != -1) usage(); operation = DO_BLF; ! rounds = atoi(optarg); extra = &rounds; break; --- 181,189 ---- if (operation != -1) usage(); operation = DO_BLF; ! rounds = strtonum(optarg, 1, INT_MAX, &errstr); ! if (errstr != NULL) ! errx(1, "%s: %s", errstr, optarg); extra = &rounds; break;