diff --git a/src/useradd.c b/src/useradd.c index 7623dabd4..4275794a7 100644 --- a/src/useradd.c +++ b/src/useradd.c @@ -2259,9 +2259,9 @@ static void create_home (void) */ for (cp = strtok(bhome, "/"); cp != NULL; cp = strtok(NULL, "/")) { /* Avoid turning a relative path into an absolute path. */ - if (bhome[0] == '/' || strlen(path) != 0) { + if (bhome[0] == '/' || !streq(path, "")) strcat(path, "/"); - } + strcat(path, cp); if (access(path, F_OK) == 0) { continue;