diff options
author | Douglas Schneider <ds3@ualberta.ca> | 2014-05-28 21:00:52 -0600 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2014-06-13 18:08:21 -0400 |
commit | 2a0784731d3e11840a62fe1e65eb7e8bd7167d71 (patch) | |
tree | 0e7ea8e779e99172609ae753e7464a0871479e7d /src | |
parent | 656408e479ded66c724a4012a8acdb21685ad362 (diff) | |
download | rneovim-2a0784731d3e11840a62fe1e65eb7e8bd7167d71.tar.gz rneovim-2a0784731d3e11840a62fe1e65eb7e8bd7167d71.tar.bz2 rneovim-2a0784731d3e11840a62fe1e65eb7e8bd7167d71.zip |
Replace vim_strncpy calls: hardcopy.c
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/hardcopy.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/nvim/hardcopy.c b/src/nvim/hardcopy.c index 35cce64735..be6d8ee0ee 100644 --- a/src/nvim/hardcopy.c +++ b/src/nvim/hardcopy.c @@ -1539,7 +1539,7 @@ static int prt_find_resource(char *name, struct prt_ps_resource_S *resource) buffer = xmallocz(MAXPATHL); - vim_strncpy(resource->name, (char_u *)name, 63); + STRLCPY(resource->name, name, 64); /* Look for named resource file in runtimepath */ STRCPY(buffer, "print"); 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)) { switch (dsc_line.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; if (seen_version) seen_all = TRUE; break; 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; if (seen_title) 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 */ if (p_mbchar->cmap_charset != NULL) { - vim_strncpy((char_u *)prt_cmap, - (char_u *)p_mbchar->cmap_charset, sizeof(prt_cmap) - 3); + STRLCPY(prt_cmap, p_mbchar->cmap_charset, sizeof(prt_cmap) - 2); STRCAT(prt_cmap, "-"); } } 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.")); 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, "-"); } |