refactor: replace char_u #18429

Work on https://github.com/neovim/neovim/issues/459
This commit is contained in:
dundargoc
2022-06-28 11:31:54 +02:00
committed by GitHub
parent 7e1cf6b764
commit 014a88799a
55 changed files with 518 additions and 558 deletions

View File

@@ -1044,9 +1044,8 @@ void call_user_func(ufunc_T *fp, int argcount, typval_T *argvars, typval_T *rett
if (tofree != NULL) {
char *s = tofree;
char buf[MSG_BUF_LEN];
if (vim_strsize((char_u *)s) > MSG_BUF_CLEN) {
trunc_string((char_u *)s, (char_u *)buf, MSG_BUF_CLEN,
sizeof(buf));
if (vim_strsize(s) > MSG_BUF_CLEN) {
trunc_string((char_u *)s, (char_u *)buf, MSG_BUF_CLEN, sizeof(buf));
s = buf;
}
msg_puts(s);
@@ -1159,7 +1158,7 @@ void call_user_func(ufunc_T *fp, int argcount, typval_T *argvars, typval_T *rett
char *tofree = s;
emsg_off--;
if (s != NULL) {
if (vim_strsize((char_u *)s) > MSG_BUF_CLEN) {
if (vim_strsize(s) > MSG_BUF_CLEN) {
trunc_string((char_u *)s, (char_u *)buf, MSG_BUF_CLEN, MSG_BUF_LEN);
s = buf;
}