mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
Use UT_NAMESIZE instead of hardcoded user names length
This commit is contained in:
parent
1642d92165
commit
447e1358b6
1 changed files with 3 additions and 2 deletions
|
|
@ -30,13 +30,14 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <pwd.h>
|
||||
#include <utmp.h>
|
||||
|
||||
#include "top.local.h"
|
||||
#include "utils.h"
|
||||
|
||||
struct hash_el {
|
||||
int uid;
|
||||
char name[9];
|
||||
char name[UT_NAMESIZE + 1];
|
||||
};
|
||||
|
||||
#define is_empty_hash(x) (hash_table[x].name[0] == 0)
|
||||
|
|
@ -125,7 +126,7 @@ int wecare; /* 1 = enter it always, 0 = nice to have */
|
|||
|
||||
/* empty or wrong slot -- fill it with new value */
|
||||
hash_table[hashindex].uid = uid;
|
||||
(void) strncpy(hash_table[hashindex].name, name, 8);
|
||||
(void) strncpy(hash_table[hashindex].name, name, UT_NAMESIZE);
|
||||
return(hashindex);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue