mirror of
https://github.com/neovim/neovim.git
synced 2025-09-18 09:18:19 +00:00
Replace vim_strncpy calls: hardcopy.c
This commit is contained in:

committed by
Justin M. Keyes

parent
656408e479
commit
2a0784731d
@@ -1539,7 +1539,7 @@ static int prt_find_resource(char *name, struct prt_ps_resource_S *resource)
|
|||||||
|
|
||||||
buffer = xmallocz(MAXPATHL);
|
buffer = xmallocz(MAXPATHL);
|
||||||
|
|
||||||
vim_strncpy(resource->name, (char_u *)name, 63);
|
STRLCPY(resource->name, name, 64);
|
||||||
/* Look for named resource file in runtimepath */
|
/* Look for named resource file in runtimepath */
|
||||||
STRCPY(buffer, "print");
|
STRCPY(buffer, "print");
|
||||||
add_pathsep(buffer);
|
add_pathsep(buffer);
|
||||||
@@ -1748,14 +1748,14 @@ static int prt_open_resource(struct prt_ps_resource_S *resource)
|
|||||||
while (!seen_all && prt_next_dsc(&dsc_line)) {
|
while (!seen_all && prt_next_dsc(&dsc_line)) {
|
||||||
switch (dsc_line.type) {
|
switch (dsc_line.type) {
|
||||||
case PRT_DSC_TITLE_TYPE:
|
case PRT_DSC_TITLE_TYPE:
|
||||||
vim_strncpy(resource->title, dsc_line.string, dsc_line.len);
|
STRLCPY(resource->title, dsc_line.string, dsc_line.len + 1);
|
||||||
seen_title = TRUE;
|
seen_title = TRUE;
|
||||||
if (seen_version)
|
if (seen_version)
|
||||||
seen_all = TRUE;
|
seen_all = TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PRT_DSC_VERSION_TYPE:
|
case PRT_DSC_VERSION_TYPE:
|
||||||
vim_strncpy(resource->version, dsc_line.string, dsc_line.len);
|
STRLCPY(resource->version, dsc_line.string, dsc_line.len + 1);
|
||||||
seen_version = TRUE;
|
seen_version = TRUE;
|
||||||
if (seen_title)
|
if (seen_title)
|
||||||
seen_all = TRUE;
|
seen_all = TRUE;
|
||||||
@@ -2160,8 +2160,7 @@ int mch_print_init(prt_settings_T *psettings, char_u *jobname, int forceit)
|
|||||||
|
|
||||||
/* Add charset name if not empty */
|
/* Add charset name if not empty */
|
||||||
if (p_mbchar->cmap_charset != NULL) {
|
if (p_mbchar->cmap_charset != NULL) {
|
||||||
vim_strncpy((char_u *)prt_cmap,
|
STRLCPY(prt_cmap, p_mbchar->cmap_charset, sizeof(prt_cmap) - 2);
|
||||||
(char_u *)p_mbchar->cmap_charset, sizeof(prt_cmap) - 3);
|
|
||||||
STRCAT(prt_cmap, "-");
|
STRCAT(prt_cmap, "-");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -2170,7 +2169,7 @@ int mch_print_init(prt_settings_T *psettings, char_u *jobname, int forceit)
|
|||||||
EMSG(_("E674: printmbcharset cannot be empty with multi-byte encoding."));
|
EMSG(_("E674: printmbcharset cannot be empty with multi-byte encoding."));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
vim_strncpy((char_u *)prt_cmap, p_pmcs, sizeof(prt_cmap) - 3);
|
STRLCPY(prt_cmap, p_pmcs, sizeof(prt_cmap) - 2);
|
||||||
STRCAT(prt_cmap, "-");
|
STRCAT(prt_cmap, "-");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user