Fix compilation warning on linux

This commit is contained in:
Linus Dierheimer
2022-09-29 15:53:28 +02:00
parent 0f47a27d09
commit 5b68cdc0dd
+5 -2
View File
@@ -20,7 +20,7 @@ void ffPrintUsers(FFinstance* instance)
setutxent();
FFlist users;
ffListInit(&users, sizeof(n->ut_user));
ffListInit(&users, sizeof(n->ut_user) + 1);
next:
while((n = getutxent()))
@@ -32,7 +32,10 @@ next:
if(strcmp((const char*)ffListGet(&users, i), n->ut_user) == 0)
goto next;
}
strcpy((char*)ffListAdd(&users), n->ut_user);
char* dest = ffListAdd(&users);
strncpy(dest, n->ut_user, sizeof(n->ut_user));
dest[sizeof(n->ut_user)] = '\0';
}
}