summaryrefslogtreecommitdiffstats
path: root/pw/pw_user.c
diff options
context:
space:
mode:
Diffstat (limited to 'pw/pw_user.c')
-rw-r--r--pw/pw_user.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/pw/pw_user.c b/pw/pw_user.c
index b51a6cb..d9bce87 100644
--- a/pw/pw_user.c
+++ b/pw/pw_user.c
@@ -214,7 +214,7 @@ pw_userlock(char *arg1, int mode)
if (arg1 == NULL)
errx(EX_DATAERR, "username or id required");
- if (strspn(arg1, "0123456789") == strlen(arg1))
+ if (arg1[strspn(arg1, "0123456789")] == '\0')
id = pw_checkid(arg1, UID_MAX);
else
name = arg1;
@@ -709,7 +709,7 @@ pw_user_show(int argc, char **argv, char *arg1)
bool quiet = false;
if (arg1 != NULL) {
- if (strspn(arg1, "0123456789") == strlen(arg1))
+ if (arg1[strspn(arg1, "0123456789")] == '\0')
id = pw_checkid(arg1, UID_MAX);
else
name = arg1;
@@ -793,7 +793,7 @@ pw_user_del(int argc, char **argv, char *arg1)
bool quiet = false;
if (arg1 != NULL) {
- if (strspn(arg1, "0123456789") == strlen(arg1))
+ if (arg1[strspn(arg1, "0123456789")] == '\0')
id = pw_checkid(arg1, UID_MAX);
else
name = arg1;
@@ -1124,7 +1124,7 @@ pw_user_add(int argc, char **argv, char *arg1)
err(EXIT_FAILURE, "calloc()");
if (arg1 != NULL) {
- if (strspn(arg1, "0123456789") == strlen(arg1))
+ if (arg1[strspn(arg1, "0123456789")] == '\0')
id = pw_checkid(arg1, UID_MAX);
else
name = arg1;
@@ -1435,7 +1435,7 @@ pw_user_mod(int argc, char **argv, char *arg1)
edited = docreatehome = false;
if (arg1 != NULL) {
- if (strspn(arg1, "0123456789") == strlen(arg1))
+ if (arg1[strspn(arg1, "0123456789")] == '\0')
id = pw_checkid(arg1, UID_MAX);
else
name = arg1;