diff options
author | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2023-01-09 14:13:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-09 21:13:06 +0800 |
commit | 149209400383c673fdb4fdd1c9a7639139f17936 (patch) | |
tree | d2c4e5fa69fc302ec3050978a303f6a479f30291 /src/nvim/option.c | |
parent | fc2cd28547954e64ef429c83733f06fa3ee75d50 (diff) | |
download | rneovim-149209400383c673fdb4fdd1c9a7639139f17936.tar.gz rneovim-149209400383c673fdb4fdd1c9a7639139f17936.tar.bz2 rneovim-149209400383c673fdb4fdd1c9a7639139f17936.zip |
refactor: replace char_u with char 17 - remove STRLCPY (#21235)
refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r-- | src/nvim/option.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index 922cf6eb4f..06de8be129 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -1455,7 +1455,7 @@ skip: } if (errmsg != NULL) { - STRLCPY(IObuff, _(errmsg), IOSIZE); + xstrlcpy(IObuff, _(errmsg), IOSIZE); int i = (int)strlen(IObuff) + 2; if (i + (arg - startarg) < IOSIZE) { // append the argument with the error @@ -4798,15 +4798,15 @@ void ExpandOldSetting(int *num_file, char ***file) /// @param opt_flags OPT_GLOBAL and/or OPT_LOCAL static void option_value2string(vimoption_T *opp, int scope) { - char_u *varp = (char_u *)get_varp_scope(opp, scope); + char *varp = get_varp_scope(opp, scope); if (opp->flags & P_NUM) { long wc = 0; - if (wc_use_keyname(varp, &wc)) { - STRLCPY(NameBuff, get_special_key_name((int)wc, 0), sizeof(NameBuff)); + if (wc_use_keyname((char_u *)varp, &wc)) { + xstrlcpy(NameBuff, (char *)get_special_key_name((int)wc, 0), sizeof(NameBuff)); } else if (wc != 0) { - STRLCPY(NameBuff, transchar((int)wc), sizeof(NameBuff)); + xstrlcpy(NameBuff, (char *)transchar((int)wc), sizeof(NameBuff)); } else { snprintf((char *)NameBuff, sizeof(NameBuff), @@ -4814,16 +4814,16 @@ static void option_value2string(vimoption_T *opp, int scope) (int64_t)(*(long *)varp)); } } else { // P_STRING - varp = *(char_u **)(varp); + varp = *(char **)(varp); if (varp == NULL) { // Just in case. NameBuff[0] = NUL; } else if (opp->flags & P_EXPAND) { - home_replace(NULL, (char *)varp, (char *)NameBuff, MAXPATHL, false); + home_replace(NULL, varp, (char *)NameBuff, MAXPATHL, false); // Translate 'pastetoggle' into special key names. } else if ((char **)opp->var == &p_pt) { str2specialbuf((const char *)p_pt, (char *)NameBuff, MAXPATHL); } else { - STRLCPY(NameBuff, varp, MAXPATHL); + xstrlcpy(NameBuff, varp, MAXPATHL); } } } |