|
@@ -3300,7 +3300,7 @@ void ImParseFormatSanitizeForPrinting(const char* fmt_in, char* fmt_out, size_t
|
|
*fmt_out = 0; // Zero-terminate
|
|
*fmt_out = 0; // Zero-terminate
|
|
}
|
|
}
|
|
|
|
|
|
-// - For scanning we need to remove all width and precision fields "%3.7f" -> "%f". BUT don't strip types like "%I64d" which includes digits. ! "%07I64d" -> "%I64d"
|
|
|
|
|
|
+// - For scanning we need to remove all width and precision fields and flags "%+3.7f" -> "%f". BUT don't strip types like "%I64d" which includes digits. ! "%07I64d" -> "%I64d"
|
|
const char* ImParseFormatSanitizeForScanning(const char* fmt_in, char* fmt_out, size_t fmt_out_size)
|
|
const char* ImParseFormatSanitizeForScanning(const char* fmt_in, char* fmt_out, size_t fmt_out_size)
|
|
{
|
|
{
|
|
const char* fmt_end = ImParseFormatFindEnd(fmt_in);
|
|
const char* fmt_end = ImParseFormatFindEnd(fmt_in);
|
|
@@ -3311,7 +3311,7 @@ const char* ImParseFormatSanitizeForScanning(const char* fmt_in, char* fmt_out,
|
|
while (fmt_in < fmt_end)
|
|
while (fmt_in < fmt_end)
|
|
{
|
|
{
|
|
char c = *fmt_in++;
|
|
char c = *fmt_in++;
|
|
- if (!has_type && ((c >= '0' && c <= '9') || c == '.'))
|
|
|
|
|
|
+ if (!has_type && ((c >= '0' && c <= '9') || c == '.' || c == '+' || c == '#'))
|
|
continue;
|
|
continue;
|
|
has_type |= ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')); // Stop skipping digits
|
|
has_type |= ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')); // Stop skipping digits
|
|
if (c != '\'' && c != '$' && c != '_') // Custom flags provided by stb_sprintf.h. POSIX 2008 also supports '.
|
|
if (c != '\'' && c != '$' && c != '_') // Custom flags provided by stb_sprintf.h. POSIX 2008 also supports '.
|