From 32e0123e1bdf7910849e35ae7c2c82576caa2c88 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 12 Nov 2016 14:01:34 +0100 Subject: [PATCH] - fixed: FResourceLump::LumpNameSetup passed negative numbers to FString::Truncate for extension-less lump names. --- src/resourcefiles/resourcefile.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/resourcefiles/resourcefile.cpp b/src/resourcefiles/resourcefile.cpp index 912998d9a..603606341 100644 --- a/src/resourcefiles/resourcefile.cpp +++ b/src/resourcefiles/resourcefile.cpp @@ -95,7 +95,8 @@ void FResourceLump::LumpNameSetup(FString iname) { long slash = iname.LastIndexOf('/'); FString base = (slash >= 0) ? iname.Mid(slash + 1) : iname; - base.Truncate(base.LastIndexOf('.')); + auto dot = base.LastIndexOf('.'); + if (dot >= 0) base.Truncate(dot); uppercopy(Name, base); Name[8] = 0; FullName = iname;