mirror of
https://github.com/neovim/neovim.git
synced 2024-12-25 21:55:17 -07:00
Replace vim_strncpy calls: misc1.c
This commit is contained in:
parent
2a0784731d
commit
a81f2dbe6e
@ -503,7 +503,7 @@ open_line (
|
|||||||
+ (second_line_indent > 0 ? second_line_indent : 0) + 1);
|
+ (second_line_indent > 0 ? second_line_indent : 0) + 1);
|
||||||
allocated = leader; /* remember to free it later */
|
allocated = leader; /* remember to free it later */
|
||||||
|
|
||||||
vim_strncpy(leader, saved_line, lead_len);
|
STRLCPY(leader, saved_line, lead_len + 1);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Replace leader with lead_repl, right or left adjusted
|
* Replace leader with lead_repl, right or left adjusted
|
||||||
@ -2560,11 +2560,9 @@ void msgmore(long n)
|
|||||||
if (pn > p_report) {
|
if (pn > p_report) {
|
||||||
if (pn == 1) {
|
if (pn == 1) {
|
||||||
if (n > 0)
|
if (n > 0)
|
||||||
vim_strncpy(msg_buf, (char_u *)_("1 more line"),
|
STRLCPY(msg_buf, _("1 more line"), MSG_BUF_LEN);
|
||||||
MSG_BUF_LEN - 1);
|
|
||||||
else
|
else
|
||||||
vim_strncpy(msg_buf, (char_u *)_("1 line less"),
|
STRLCPY(msg_buf, _("1 line less"), MSG_BUF_LEN);
|
||||||
MSG_BUF_LEN - 1);
|
|
||||||
} else {
|
} else {
|
||||||
if (n > 0)
|
if (n > 0)
|
||||||
vim_snprintf((char *)msg_buf, MSG_BUF_LEN,
|
vim_snprintf((char *)msg_buf, MSG_BUF_LEN,
|
||||||
@ -3109,7 +3107,7 @@ char_u *get_env_name(expand_T *xp, int idx)
|
|||||||
static char_u name[ENVNAMELEN];
|
static char_u name[ENVNAMELEN];
|
||||||
char *envname = os_getenvname_at_index(idx);
|
char *envname = os_getenvname_at_index(idx);
|
||||||
if (envname) {
|
if (envname) {
|
||||||
vim_strncpy(name, (char_u *)envname, ENVNAMELEN - 1);
|
STRLCPY(name, envname, ENVNAMELEN);
|
||||||
free(envname);
|
free(envname);
|
||||||
return name;
|
return name;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user