=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/find/function.c,v retrieving revision 1.43 retrieving revision 1.44 diff -c -r1.43 -r1.44 *** src/usr.bin/find/function.c 2015/03/15 00:41:28 1.43 --- src/usr.bin/find/function.c 2015/04/18 18:28:37 1.44 *************** *** 1,4 **** ! /* $OpenBSD: function.c,v 1.43 2015/03/15 00:41:28 millert Exp $ */ /*- * Copyright (c) 1990, 1993 --- 1,4 ---- ! /* $OpenBSD: function.c,v 1.44 2015/04/18 18:28:37 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993 *************** *** 883,890 **** g = getgrnam(gname); if (g == NULL) { ! gid = atoi(gname); ! if (gid == 0 && gname[0] != '0') errx(1, "-group: %s: no such group", gname); } else gid = g->gr_gid; --- 883,892 ---- g = getgrnam(gname); if (g == NULL) { ! const char *errstr; ! ! gid = strtonum(gname, 0, GID_MAX, &errstr); ! if (errstr) errx(1, "-group: %s: no such group", gname); } else gid = g->gr_gid; *************** *** 1014,1022 **** c_mindepth(char *arg, char ***ignored, int unused) { PLAN *new; new = palloc(N_MINDEPTH, f_mindepth); ! new->min_data = atoi(arg); return (new); } --- 1016,1027 ---- c_mindepth(char *arg, char ***ignored, int unused) { PLAN *new; + const char *errstr = NULL; new = palloc(N_MINDEPTH, f_mindepth); ! new->min_data = strtonum(arg, 0, INT_MAX, &errstr); ! if (errstr) ! errx(1, "-mindepth: %s: value %s", arg, errstr); return (new); } *************** *** 1488,1495 **** p = getpwnam(username); if (p == NULL) { ! uid = atoi(username); ! if (uid == 0 && username[0] != '0') errx(1, "-user: %s: no such user", username); } else uid = p->pw_uid; --- 1493,1502 ---- p = getpwnam(username); if (p == NULL) { ! const char *errstr; ! ! uid = strtonum(username, 0, UID_MAX, &errstr); ! if (errstr) errx(1, "-user: %s: no such user", username); } else uid = p->pw_uid;