refactor: replace sprintf with snprintf #15794

This commit is contained in:
dundargoc
2021-09-26 16:53:51 +02:00
committed by GitHub
parent 68d6ff8802
commit c273eb3100
2 changed files with 9 additions and 7 deletions

View File

@@ -8807,9 +8807,9 @@ char_u *set_cmdarg(exarg_T *eap, char_u *oldarg)
char_u *newval = xmalloc(newval_len);
if (eap->force_bin == FORCE_BIN) {
sprintf((char *)newval, " ++bin");
snprintf((char *)newval, newval_len, " ++bin");
} else if (eap->force_bin == FORCE_NOBIN) {
sprintf((char *)newval, " ++nobin");
snprintf((char *)newval, newval_len, " ++nobin");
} else {
*newval = NUL;
}