From 94e4357fd4e2a3a3441ce43be82a8119e2395bfd Mon Sep 17 00:00:00 2001 From: radius Date: Sat, 24 Mar 2018 19:03:55 -0500 Subject: [PATCH] return early in case path is null and move vars to the top --- cheevos/cheevos.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cheevos/cheevos.c b/cheevos/cheevos.c index 1d41d3d016..57f027641f 100644 --- a/cheevos/cheevos.c +++ b/cheevos/cheevos.c @@ -3358,10 +3358,9 @@ found: * Output CHEEVOS_VAR_GAMEID the Retro Achievements game ID, or 0 if not found *************************************************************************/ CORO_SUB(FILENAME_MD5) - { - char base_noext[PATH_MAX_LENGTH]; if (!string_is_empty(coro->path)) { + char base_noext[PATH_MAX_LENGTH]; fill_pathname_base_noext(base_noext, coro->path, sizeof(base_noext)); MD5_Init(&coro->md5); @@ -3370,7 +3369,7 @@ found: CORO_GOTO(GET_GAMEID); } - } + CORO_RET(); /************************************************************************** * Info Evaluates the CHEEVOS_VAR_MD5 hash