X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=radiant%2Fshaders.cpp;fp=radiant%2Fshaders.cpp;h=f02474e0686f7e3ff13b7e4316396d6f7655f6e9;hb=eef39952025db1375e33b6e314692ac76badb93c;hp=f62e3f61c8db3103ab1d3d197c809a767f9957a3;hpb=af4e2d29cfd3a54b44eb09e4289f3fa3f29412c9;p=xonotic%2Fnetradiant.git diff --git a/radiant/shaders.cpp b/radiant/shaders.cpp index f62e3f61..f02474e0 100644 --- a/radiant/shaders.cpp +++ b/radiant/shaders.cpp @@ -70,7 +70,8 @@ void ViewShader( const char *pFile, const char *pName ){ break; } } - for ( const char* i = substr + strlen( strFind.c_str() ); i < strLook.c_str() + strlen( strLook.c_str() ); i++ ){ + const char* b = strLook.c_str() + strlen( strLook.c_str() ); + for ( const char* i = substr + strlen( strFind.c_str() ); i < b; i++ ){ if( (strncmp( i, "\t", 1 ) == 0) || (strncmp( i, " ", 1 ) == 0) ){ endOK = true; continue; @@ -113,7 +114,8 @@ void ViewShader( const char *pFile, const char *pName ){ break;*/ } //fix up length - for ( const char* i = strLook.c_str(); i < strLook.c_str() + strlen( strLook.c_str() ) - 1; i++ ){ + const char* b = strLook.c_str() + strlen( strLook.c_str() ) - 1; + for ( const char* i = strLook.c_str(); i < b; i++ ){ if ( (strncmp( i, "\r\n", 2 ) == 0) ){ length--; }