1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 01:48:00 +00:00

Fix segfault when HOME not set on Unix.

[originally from svn r4948]
This commit is contained in:
Owen Dunn 2004-12-07 11:50:44 +00:00
parent e83034fe3f
commit 30e94b6a5c

View File

@ -85,6 +85,8 @@ static void make_filename(char *filename, int index, const char *subname)
char *home;
int len;
home = getenv("HOME");
if (!home)
home="/";
strncpy(filename, home, FILENAME_MAX);
len = strlen(filename);
if (index == INDEX_SESSION) {