summaryrefslogtreecommitdiff
path: root/src/hardcopy.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2011-04-11 16:56:35 +0200
committerBram Moolenaar <Bram@vim.org>2011-04-11 16:56:35 +0200
commitef9d6aa70d68cd3a765ed55f4c3781aeb8aeea23 (patch)
treee099b52d0ebf51c535ebe3cd875d8f70c06332df /src/hardcopy.c
parent0d35e91abfa9e17f7c554bfd33b119b879448c72 (diff)
downloadvim-git-ef9d6aa70d68cd3a765ed55f4c3781aeb8aeea23.tar.gz
updated for version 7.3.160v7.3.160
Problem: Unsafe string copying. Solution: Use vim_strncpy() instead of strcpy(). Use vim_strcat() instead of strcat().
Diffstat (limited to 'src/hardcopy.c')
-rw-r--r--src/hardcopy.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/hardcopy.c b/src/hardcopy.c
index 0747dc9d3..2310484f9 100644
--- a/src/hardcopy.c
+++ b/src/hardcopy.c
@@ -1761,12 +1761,12 @@ prt_find_resource(name, resource)
{
char_u buffer[MAXPATHL + 1];
- STRCPY(resource->name, name);
+ vim_strncpy(resource->name, (char_u *)name, 63);
/* Look for named resource file in runtimepath */
STRCPY(buffer, "print");
add_pathsep(buffer);
- STRCAT(buffer, name);
- STRCAT(buffer, ".ps");
+ vim_strcat(buffer, (char_u *)name, MAXPATHL);
+ vim_strcat(buffer, (char_u *)".ps", MAXPATHL);
resource->filename[0] = NUL;
return (do_in_runtimepath(buffer, FALSE, prt_resource_name,
resource->filename)