diff --git a/Quake/cfgfile.c b/Quake/cfgfile.c index a0a37311..364b5f69 100644 --- a/Quake/cfgfile.c +++ b/Quake/cfgfile.c @@ -2,9 +2,7 @@ cfgfile.c misc reads from the config file - $Id: cfgfile.c 3880 2011-01-28 21:50:19Z sezero $ - - Copyright (C) 2008-2010 O.Sezer + Copyright (C) 2008-2011 O.Sezer This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -126,11 +124,11 @@ void CFG_ReadCvarOverrides (const char **vars, int num_vars) return; buff[0] = '+'; + buff[sizeof(buff) - 1] = '\0'; for (i = 0; i < num_vars; i++) { - strncpy (&buff[1], vars[i], sizeof(buff) - 1); - buff[sizeof(buff) - 1] = 0; + strncpy (&buff[1], vars[i], sizeof(buff) - 2); j = COM_CheckParm(buff); if (j != 0 && j < com_argc - 1) { diff --git a/Quake/cfgfile.h b/Quake/cfgfile.h index 617e27d7..5ad09d9d 100644 --- a/Quake/cfgfile.h +++ b/Quake/cfgfile.h @@ -2,9 +2,7 @@ cfgfile.h misc reads from the config file - $Id: cfgfile.h 3862 2010-12-30 20:51:57Z sezero $ - - Copyright (C) 2008-2010 O.Sezer + Copyright (C) 2008-2011 O.Sezer This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License