mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.1.1271: compiler warnings for use of STRNCPY()
Problem: Compiler warnings for use of STRNCPY(). (John Marriott)
Solution: Use mch_memmove() instead of STRNCPY().
b3de6c4a76
This commit is contained in:
parent
777c2a25ce
commit
6cee73195f
@ -1164,9 +1164,9 @@ int do_search(
|
|||||||
if (utf_iscomposing(utf_ptr2char(p))) {
|
if (utf_iscomposing(utf_ptr2char(p))) {
|
||||||
// Use a space to draw the composing char on.
|
// Use a space to draw the composing char on.
|
||||||
msgbuf[1] = ' ';
|
msgbuf[1] = ' ';
|
||||||
STRNCPY(msgbuf + 2, p, STRLEN(p));
|
memmove(msgbuf + 2, p, STRLEN(p));
|
||||||
} else {
|
} else {
|
||||||
STRNCPY(msgbuf + 1, p, STRLEN(p));
|
memmove(msgbuf + 1, p, STRLEN(p));
|
||||||
}
|
}
|
||||||
if (spats[0].off.line || spats[0].off.end || spats[0].off.off) {
|
if (spats[0].off.line || spats[0].off.end || spats[0].off.off) {
|
||||||
p = msgbuf + STRLEN(p) + 1;
|
p = msgbuf + STRLEN(p) + 1;
|
||||||
@ -4280,7 +4280,7 @@ static void search_stat(int dirc, pos_T *pos, char_u *msgbuf)
|
|||||||
vim_snprintf(t, STAT_BUF_LEN, "[%d/%d]", cur, cnt);
|
vim_snprintf(t, STAT_BUF_LEN, "[%d/%d]", cur, cnt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
STRNCPY(msgbuf + STRLEN(msgbuf) - STRLEN(t), t, STRLEN(t));
|
memmove(msgbuf + STRLEN(msgbuf) - STRLEN(t), t, STRLEN(t));
|
||||||
if (dirc == '?' && cur == 100) {
|
if (dirc == '?' && cur == 100) {
|
||||||
cur = -1;
|
cur = -1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user