strndup() could return a non-NULL terminated string
size_t should be printed with %lu when expending tildes (~), an extra slash was inserted after the user's home directory
This commit is contained in:
parent
bb62e2c18d
commit
2881d173b5
3
config.c
3
config.c
|
@ -79,7 +79,10 @@ expand_strdup (const char *s)
|
|||
|
||||
p = strchr (s, '/');
|
||||
if (p)
|
||||
{
|
||||
user = strndup (s, (int)(p - s));
|
||||
p++;
|
||||
}
|
||||
else
|
||||
user = strdup (s);
|
||||
pw = getpwnam (user);
|
||||
|
|
Loading…
Reference in New Issue
Block a user