The following commit has been merged in the next branch: commit b099a1286065e90a536da1f3e257dccb3b93ad42 Author: Marek Lindner lindner_marek@yahoo.de Date: Thu Sep 16 15:13:12 2010 +0200
batctl: fix crash if HOME environment variable is not set
Signed-off-by: Marek Lindner lindner_marek@yahoo.de
diff --git a/bat-hosts.c b/bat-hosts.c index 8948892..5802e80 100644 --- a/bat-hosts.c +++ b/bat-hosts.c @@ -181,6 +181,9 @@ void bat_hosts_init(void)
if (strlen(bat_hosts_path[i]) >= 2 && bat_hosts_path[i][0] == '~' && bat_hosts_path[i][1] == '/') { + if (!homedir) + continue; + strncpy(confdir, homedir, CONF_DIR_LEN); confdir[CONF_DIR_LEN - 1] = '\0'; strncat(confdir, &bat_hosts_path[i][1], CONF_DIR_LEN - strlen(confdir));