From 51161004ebb971e832eec8de9fa4fb2091115455 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sun, 4 Dec 2022 05:24:35 +0300 Subject: [PATCH] engine: common: simplify string operations --- engine/common/con_utils.c | 3 ++- engine/common/cvar.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/engine/common/con_utils.c b/engine/common/con_utils.c index 8bafcb31..aad0b289 100644 --- a/engine/common/con_utils.c +++ b/engine/common/con_utils.c @@ -1324,8 +1324,9 @@ static void Cmd_WriteHelp(const char *name, const char *unused, const char *desc { int length; - if( !desc || !Q_strcmp( desc, "" )) + if( !COM_CheckString( desc )) return; // ignore fantom cmds + if( name[0] == '+' || name[0] == '-' ) return; // key bindings diff --git a/engine/common/cvar.c b/engine/common/cvar.c index b89abdfb..569db02a 100644 --- a/engine/common/cvar.c +++ b/engine/common/cvar.c @@ -409,7 +409,7 @@ convar_t *Cvar_Get( const char *name, const char *value, int flags, const char * // which executed from the config file. So we don't need to // change value here: we *already* have actual value from config. // in other cases we need to rewrite them - if( Q_strcmp( var->desc, "" )) + if( COM_CheckStringEmpty( var->desc )) { // directly set value freestring( var->string );