mirror of https://github.com/OpenRCT2/OpenRCT2.git
Fix safe_strncpy being unsafe
This commit is contained in:
parent
8d2641a2a1
commit
97fc78a506
|
@ -188,7 +188,7 @@ void console_draw(rct_drawpixelinfo *dpi)
|
||||||
int lineLength = min(sizeof(lineBuffer) - (size_t)utf8_get_codepoint_length(FORMAT_GREEN), (size_t)(nextLine - ch));
|
int lineLength = min(sizeof(lineBuffer) - (size_t)utf8_get_codepoint_length(FORMAT_GREEN), (size_t)(nextLine - ch));
|
||||||
lineCh = lineBuffer;
|
lineCh = lineBuffer;
|
||||||
lineCh = utf8_write_codepoint(lineCh, FORMAT_GREEN);
|
lineCh = utf8_write_codepoint(lineCh, FORMAT_GREEN);
|
||||||
safe_strncpy(lineCh, ch, CONSOLE_BUFFER_SIZE);
|
strncpy(lineCh, ch, lineLength);
|
||||||
lineCh[lineLength] = 0;
|
lineCh[lineLength] = 0;
|
||||||
|
|
||||||
gfx_draw_string(dpi, lineBuffer, 255, x, y);
|
gfx_draw_string(dpi, lineBuffer, 255, x, y);
|
||||||
|
|
Loading…
Reference in New Issue