render: urls: fix string formatter in swprintf()

This commit is contained in:
Daniel Eklöf 2021-02-07 10:51:09 +01:00
parent b3043e92f6
commit 85f7503aec
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -2585,7 +2585,7 @@ render_urls(struct terminal *term)
if (text_len == 0)
wcscpy(label, key);
else {
int count = swprintf(label, chars, L"%s - %s", key, text);
int count = swprintf(label, chars + 1, L"%ls - %ls", key, text);
if (count >= max_chars) {
label[max_chars] = L'';
label[max_chars + 1] = L'\0';