mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-21 19:51:49 +00:00
COMMON: Fix handling escaped percents in Common::U32String::format
This commit is contained in:
parent
29024cded7
commit
3441c7230d
@ -236,6 +236,10 @@ int U32String::vformat(const value_type *fmt, const value_type *fmtEnd, U32Strin
|
||||
output.insertChar(int_temp, pos);
|
||||
++length;
|
||||
break;
|
||||
case '%':
|
||||
output.insertChar('%', pos);
|
||||
++length;
|
||||
break;
|
||||
default:
|
||||
warning("Unexpected formatting type for U32String::Format.");
|
||||
break;
|
||||
|
@ -377,6 +377,8 @@ class StringTestSuite : public CxxTest::TestSuite
|
||||
TS_ASSERT_EQUALS( Common::U32String::format("%d", 0).encode(), "0" );
|
||||
TS_ASSERT_EQUALS( Common::U32String::format("%d", 1234).encode(), "1234" );
|
||||
TS_ASSERT_EQUALS( Common::U32String::format("%d", -1234).encode(), "-1234" );
|
||||
|
||||
TS_ASSERT_EQUALS( Common::U32String::format("%u %%", 100).encode(), "100 %" );
|
||||
}
|
||||
|
||||
void test_strlcpy() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user