From 48d03ea9051341b4b74a1a30a478a3d961baa835 Mon Sep 17 00:00:00 2001 From: "Timothee \"TTimo\" Besset" Date: Sun, 27 Sep 2015 15:48:42 -0500 Subject: [PATCH] fix crash --- plugins/map/parse.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/map/parse.cpp b/plugins/map/parse.cpp index 953bdd95..f626d457 100644 --- a/plugins/map/parse.cpp +++ b/plugins/map/parse.cpp @@ -28,6 +28,7 @@ // #include "plugin.h" +#include // cmdlib extern void ExtractFileName( const char *path, char *dest, size_t size ); @@ -202,7 +203,7 @@ void Patch_Parse( patchMesh_t *pPatch ){ GetToken( true ); str = new char[strlen( token ) + 10]; strcpy( str, "textures/" ); - Q_strncpyz( str + 9, token, sizeof( str ) - 9 ); + Q_strncpyz( str + 9, token, strlen( token ) + 10 - 9 ); pPatch->pShader = QERApp_Shader_ForName( str ); pPatch->d_texture = pPatch->pShader->getTexture(); delete [] str;