From 63d8794902594a801315402ecf86b6d57131c9d5 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sun, 29 Nov 2020 05:51:00 +0500 Subject: [PATCH] ref_soft: r_image.c: remove duplicated Q_strlen() call. --- ref_soft/r_image.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ref_soft/r_image.c b/ref_soft/r_image.c index b4f353f2..09623325 100644 --- a/ref_soft/r_image.c +++ b/ref_soft/r_image.c @@ -805,13 +805,17 @@ GL_CheckTexName */ qboolean GL_CheckTexName( const char *name ) { + int len; + if( !COM_CheckString( name ) ) return false; + len = Q_strlen( name ); + // because multi-layered textures can exceed name string - if( Q_strlen( name ) >= sizeof( r_images->name )) + if( len >= sizeof( r_images->name )) { - gEngfuncs.Con_Printf( S_ERROR "LoadTexture: too long name %s (%d)\n", name, Q_strlen( name )); + gEngfuncs.Con_Printf( S_ERROR "LoadTexture: too long name %s (%d)\n", name, len); return false; }