fixes SEGV if no HOME environment var

This commit is contained in:
nohar 2006-02-02 09:00:42 +00:00
parent ebc7ec7f4e
commit 08050235ed
1 changed files with 3 additions and 1 deletions

View File

@ -677,8 +677,10 @@ int fireup(FILE *conf)
if (!conf_biphome) {
char *home = getenv("HOME");
if (!home)
if (!home) {
conf_die("no $HOME !, do you live in a trailer ?");
return 0;
}
conf_biphome = malloc(strlen(home) + strlen("/.bip") + 1);
strcpy(conf_biphome, home);
strcat(conf_biphome, "/.bip");