From e4586e53ad38bae349e1da1fd60d58cf9b07faa9 Mon Sep 17 00:00:00 2001 From: RSDuck Date: Mon, 1 May 2023 02:34:59 +0200 Subject: [PATCH] fix UB --- src/frontend/qt_sdl/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/frontend/qt_sdl/main.cpp b/src/frontend/qt_sdl/main.cpp index b0f1538d..47936b43 100644 --- a/src/frontend/qt_sdl/main.cpp +++ b/src/frontend/qt_sdl/main.cpp @@ -1325,14 +1325,14 @@ static bool SupportedArchiveByMimetype(const QMimeType& mimetype) static bool ZstdNdsRomByExtension(const QString& filename) { - if (filename.endsWith(".zst", Qt::CaseInsensitive)) - return NdsRomByExtension(filename.left(filename.size() - 4)); + return filename.endsWith(".zst", Qt::CaseInsensitive) && + NdsRomByExtension(filename.left(filename.size() - 4)); } static bool ZstdGbaRomByExtension(const QString& filename) { - if (filename.endsWith(".zst", Qt::CaseInsensitive)) - return GbaRomByExtension(filename.left(filename.size() - 4)); + return filename.endsWith(".zst", Qt::CaseInsensitive) && + GbaRomByExtension(filename.left(filename.size() - 4)); } static bool FileIsSupportedFiletype(const QString& filename, bool insideArchive = false)