Skip to content

Commit

Permalink
fix UB
Browse files Browse the repository at this point in the history
  • Loading branch information
RSDuck committed May 1, 2023
1 parent 81c284b commit e4586e5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/frontend/qt_sdl/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e4586e5

Please sign in to comment.