mirror of
https://github.com/ocornut/imgui.git
synced 2026-08-21 14:51:17 +00:00
Fixed GCC false positive. (#9508)
This commit is contained in:
@@ -3635,6 +3635,7 @@ const char* ImParseFormatTrimDecorations(const char* fmt, char* buf, size_t buf_
|
||||
const char* fmt_end = ImParseFormatFindEnd(fmt_start);
|
||||
if (fmt_end[0] == 0) // If we only have leading decoration, we don't need to copy the data.
|
||||
return fmt_start;
|
||||
buf[0] = 0; // Fix false positive with caller assuming that buf could be non-initialized (#9508)
|
||||
ImStrncpy(buf, fmt_start, ImMin((size_t)(fmt_end - fmt_start) + 1, buf_size));
|
||||
return buf;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user