if (!home) home="/";
static void make_filename(char *filename, int index, const char *subname){    char *home;    int len;    home = getenv("HOME");    strncpy(filename, home, FILENAME_MAX);    len = strlen(filename);    if (index == INDEX_SESSION) {        char *munged = mungestr(subname);        char *fn = dupprintf("/.putty/sessions/%s", munged);        strncpy(filename + len, fn, FILENAME_MAX - len);        sfree(fn);        sfree(munged);    } else {        strncpy(filename + len,                index == INDEX_DIR ? "/.putty" :                index == INDEX_SESSIONDIR ? "/.putty/sessions" :                index == INDEX_HOSTKEYS ? "/.putty/sshhostkeys" :                index == INDEX_HOSTKEYS_TMP ? "/.putty/sshhostkeys.tmp" :                index == INDEX_RANDSEED ? "/.putty/randomseed" :                "/.putty/ERROR", FILENAME_MAX - len);    }    filename[FILENAME_MAX-1] = '\0';}