From: Joe Wreschnig Date: Thu, 4 Apr 2013 10:11:27 +0000 (+0200) Subject: Prevent crash due to buffer overflow detection (and on some platforms probably actual... X-Git-Url: https://git.yukkurigames.com/?a=commitdiff_plain;h=5b5f1f3eee71701d67c3ac4cc032c574423a5197;p=rogue-pphs.git Prevent crash due to buffer overflow detection (and on some platforms probably actual buffer overflow). --- diff --git a/main.c b/main.c index 32fdbd0..59240e0 100644 --- a/main.c +++ b/main.c @@ -58,7 +58,7 @@ char **envp; /* * get home and options from environment */ - strncpy(home, md_gethomedir(), PATH_MAX); + strncpy(home, md_gethomedir(), sizeof(home) - 1); strcpy(file_name, home); strcat(file_name, "rogue36.sav");