From 99ddd54c1fccd36c0210cfba122551ef501333da Mon Sep 17 00:00:00 2001 From: iedowse Date: Fri, 9 Aug 2002 01:21:03 +0000 Subject: Improve the code for detecting UID ranges so that usernames such as "2-xhibit" are not considered as a range. Fix a problem where the code would forget to increment argv. PR: misc/15658 --- usr.sbin/edquota/edquota.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'usr.sbin/edquota') diff --git a/usr.sbin/edquota/edquota.c b/usr.sbin/edquota/edquota.c index e7be4b7..0e1a988 100644 --- a/usr.sbin/edquota/edquota.c +++ b/usr.sbin/edquota/edquota.c @@ -147,8 +147,8 @@ main(int argc, char **argv) qup->dqblk.dqb_btime = 0; qup->dqblk.dqb_itime = 0; } - while (argc-- > 0) { - if (isdigit(*argv[0]) && + for (; argc-- > 0; argv++) { + if (strspn(*argv, "0123456789-") == strlen(*argv) && (cp = strchr(*argv, '-')) != NULL) { *cp++ = '\0'; startuid = atoi(*argv); @@ -166,7 +166,7 @@ main(int argc, char **argv) } continue; } - if ((id = getentry(*argv++, quotatype)) < 0) + if ((id = getentry(*argv, quotatype)) < 0) continue; putprivs(id, quotatype, protoprivs); } -- cgit v1.1