From fe561ecdeec365b0b6d440b1034a9770813257c5 Mon Sep 17 00:00:00 2001 From: aryanrawlani28 Date: Mon, 31 Aug 2020 00:19:53 +0530 Subject: [PATCH] COMMON: U32: Fix incorrect usage of %i - %i & %d work in the same manner. --- common/ustr.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/common/ustr.cpp b/common/ustr.cpp index 992cefbab40..843672d58a3 100644 --- a/common/ustr.cpp +++ b/common/ustr.cpp @@ -641,6 +641,8 @@ int U32String::vformat(U32String::const_iterator fmt, const U32String::const_ite output.insertString(string_temp, pos); pos += len - 1; break; + case 'i': + // fallthrough intended case 'd': int_temp = va_arg(args, int); itoa(int_temp, buffer, 10); @@ -656,15 +658,6 @@ int U32String::vformat(U32String::const_iterator fmt, const U32String::const_ite len = strlen(buffer); length += len; - output.insertString(buffer, pos); - pos += len - 1; - break; - case 'i': - int_temp = va_arg(args, uint16); - itoa(int_temp, buffer, 10); - len = strlen(buffer); - length += len; - output.insertString(buffer, pos); pos += len - 1; break;