diff options
Diffstat (limited to 'UsersTable.c')
-rw-r--r-- | UsersTable.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/UsersTable.c b/UsersTable.c index 49a5159..ecabb0a 100644 --- a/UsersTable.c +++ b/UsersTable.c @@ -1,23 +1,25 @@ /* htop - UsersTable.c -(C) 2004-2010 Hisham H. Muhammad +(C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "UsersTable.h" -#include "Hashtable.h" -#include "String.h" + +#include "config.h" #include <stdio.h> +#include <string.h> #include <strings.h> #include <pwd.h> #include <sys/types.h> - -#include "debug.h" +#include <stdlib.h> #include <assert.h> /*{ +#include "Hashtable.h" + typedef struct UsersTable_ { Hashtable* users; } UsersTable; @@ -40,7 +42,7 @@ char* UsersTable_getRef(UsersTable* this, unsigned int uid) { if (name == NULL) { struct passwd* userData = getpwuid(uid); if (userData != NULL) { - name = String_copy(userData->pw_name); + name = strdup(userData->pw_name); Hashtable_put(this->users, uid, name); } } |