mirror of
https://github.com/javalsai/lidm.git
synced 2025-07-03 14:25:03 +02:00
fix: no human users found
This commit is contained in:
parent
7db89e973d
commit
c88bdaea06
@ -46,7 +46,9 @@ struct Vector get_human_users() {
|
|||||||
|
|
||||||
struct passwd* NULLABLE pwd;
|
struct passwd* NULLABLE pwd;
|
||||||
while ((pwd = getpwent()) != NULL) {
|
while ((pwd = getpwent()) != NULL) {
|
||||||
if (!pwd->pw_dir || strcmp(pwd->pw_dir, "/home/") != 0) continue;
|
// `- 1` bcs sizeof counts the nullbyte
|
||||||
|
if (pwd->pw_dir && strncmp(pwd->pw_dir, "/home/", sizeof("/home/") - 1) != 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
struct user* user_i = malloc(sizeof(struct user));
|
struct user* user_i = malloc(sizeof(struct user));
|
||||||
if (user_i == NULL) continue; // malloc error
|
if (user_i == NULL) continue; // malloc error
|
||||||
|
Loading…
x
Reference in New Issue
Block a user