Check home is null

This commit is contained in:
mattn
2013-07-23 12:13:50 +09:00
parent 29a3f8b8e3
commit c8f1f7fdf6
+6 -4
View File
@@ -285,10 +285,12 @@ main(int argc, char **argv)
if (!home)
home = getenv("USERPROFILE");
#endif
strcpy(history_path, home);
strcat(history_path, "/");
strcat(history_path, history_file_name);
read_history(history_path);
if (home) {
strcpy(history_path, home);
strcat(history_path, "/");
strcat(history_path, history_file_name);
read_history(history_path);
}
#endif