0
0
mirror of https://github.com/vim/vim.git synced 2025-09-28 04:24:06 -04:00

updated for version 7.3.160

Problem:    Unsafe string copying.
Solution:   Use vim_strncpy() instead of strcpy().  Use vim_strcat() instead
            of strcat().
This commit is contained in:
Bram Moolenaar
2011-04-11 16:56:35 +02:00
parent 0d35e91abf
commit ef9d6aa70d
13 changed files with 63 additions and 32 deletions

View File

@@ -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)