render: oops... swprintf() needs to number of *chars*, not *bytes*

This commit is contained in:
Daniel Eklöf 2020-08-13 18:46:57 +02:00
parent 6e0171ee44
commit 823a7c0318
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -1491,7 +1491,7 @@ render_render_timer(struct terminal *term, struct timeval render_time)
wchar_t text[256];
double usecs = render_time.tv_sec * 1000000 + render_time.tv_usec;
swprintf(text, sizeof(text), L"%.2f µs", usecs);
swprintf(text, sizeof(text) / sizeof(text[0]), L"%.2f µs", usecs);
const int cell_count = wcslen(text);
const int margin = 3 * term->scale;