COMMON: Fix handling escaped percents in Common::U32String::format
This commit is contained in:
parent
29024cded7
commit
3441c7230d
2 changed files with 6 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue