Avoid some unnecessary casts and mark some not changing variables const

This commit is contained in:
Christian Göttsche
2020-10-27 11:46:29 +01:00
committed by cgzones
parent 27870bd4de
commit ac2b07eddd
7 changed files with 16 additions and 17 deletions

View File

@ -30,9 +30,9 @@ void UsersTable_delete(UsersTable* this) {
}
char* UsersTable_getRef(UsersTable* this, unsigned int uid) {
char* name = (char*) (Hashtable_get(this->users, uid));
char* name = Hashtable_get(this->users, uid);
if (name == NULL) {
struct passwd* userData = getpwuid(uid);
const struct passwd* userData = getpwuid(uid);
if (userData != NULL) {
name = xStrdup(userData->pw_name);
Hashtable_put(this->users, uid, name);