sgml: dismiss MSVC warnings

Brain-dead _Printf_format_string_ SAL doesn't understand utf32_t is good
enough for unsigned int expected by %x placeholder.

Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
Simon Rozman 2024-02-19 09:16:06 +01:00
parent 10f999c7bf
commit 87d678f524

View File

@ -618,7 +618,7 @@ namespace stdex
unicode = src[i++];
}
char tmp[3 + 8 + 1 + 1];
snprintf(tmp, _countof(tmp), "&#x%x;", unicode);
snprintf(tmp, _countof(tmp), "&#x%x;", static_cast<unsigned int>(unicode));
dst.append(tmp);
}
}
@ -760,7 +760,7 @@ namespace stdex
unicode = src[i++];
}
char tmp[3 + 8 + 1 + 1];
int m = snprintf(tmp, _countof(tmp), "&#x%x;", unicode);
int m = snprintf(tmp, _countof(tmp), "&#x%x;", static_cast<unsigned int>(unicode));
_Assume_(m >= 0);
if (static_cast<size_t>(m) >= count_dst)
throw buffer_overrun;