1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-06-29 01:56:44 +02:00

Fix an edge case when obtaining home directory.

Make the path to home directory empty before calling get_home_dir(), otherwise if the call fails, the contents are undefined.
This commit is contained in:
dantok
2015-01-25 20:48:02 +01:00
parent a561ef8c49
commit 37b3b5a5ed
2 changed files with 2 additions and 0 deletions

View File

@ -67,6 +67,7 @@ void get_home_dir(char *home, int size)
char *get_user_config_dir(void)
{
char home[NSS_BUFLEN_PASSWD];
home[0] = '\0';
get_home_dir(home, sizeof(home));
char *user_config_dir;