diff --git a/polymer/eduke32/source/demo.c b/polymer/eduke32/source/demo.c index 6ebc08ee9..7e6a4c6ab 100644 --- a/polymer/eduke32/source/demo.c +++ b/polymer/eduke32/source/demo.c @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "menus.h" #include "savegame.h" -char firstdemofile[80]; +char firstdemofile[BMAX_PATH]; FILE *g_demo_filePtr = (FILE *)NULL; int32_t g_demo_cnt; diff --git a/polymer/eduke32/source/demo.h b/polymer/eduke32/source/demo.h index 0763cb16e..006d24c04 100644 --- a/polymer/eduke32/source/demo.h +++ b/polymer/eduke32/source/demo.h @@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define __demo_h__ extern FILE *g_demo_filePtr; -extern char firstdemofile[80]; +extern char firstdemofile[BMAX_PATH]; extern int32_t demoplay_diffs; extern int32_t demoplay_showsync; diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 96a25f0d0..a2e4c42f8 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -8770,12 +8770,17 @@ static void G_CheckCommandLine(int32_t argc, const char **argv) ud.m_coop--; break; case 'd': + { + char *dot; + c++; - if (strchr(c,'.') == 0) - Bstrcat(c,".edm"); - initprintf("Play demo %s.\n",c); Bstrcpy(firstdemofile,c); + dot = Bstrchr(firstdemofile,'.'); + if (!dot && Bstrlen(firstdemofile)+4 < sizeof(firstdemofile)) + Bstrcat(firstdemofile,".edm"); + initprintf("Play demo %s.\n",firstdemofile); break; + } case 'g': c++; if (!*c) break;