input: legacy: reduce size of reply buffer

Its maximum size is known; the only two variables are two integers. We
know the maximum length of an integer converted to a string.
This commit is contained in:
Daniel Eklöf 2021-11-21 15:05:38 +01:00
parent 28ad0ca602
commit ce8ea2db66
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -1083,7 +1083,7 @@ legacy_kbd_protocol(struct seat *seat, struct terminal *term,
int modify_param = mod_param_map[keymap_mods];
xassert(modify_param != 0);
char reply[1024];
char reply[32];
size_t n = xsnprintf(reply, sizeof(reply), "\x1b[27;%d;%d~", modify_param, sym);
term_to_slave(term, reply, n);
}