cygcheck: Use snprintf instead of multiple strcat
This not only simplifies the code but also fixes potential memory corruption Fixes Coverity CID 66952 Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
parent
f16f20ff95
commit
9807a501b1
|
@ -311,10 +311,7 @@ pathlike::check_existence (const char *fn, int showall, int verbose,
|
|||
char* first, const char *ext1, const char *ext2)
|
||||
{
|
||||
char file[4000];
|
||||
strcpy (file, dir);
|
||||
strcat (file, fn);
|
||||
strcat (file, ext1);
|
||||
strcat (file, ext2);
|
||||
snprintf (file, sizeof file, "%s%s%s%s", dir, fn, ext1, ext2);
|
||||
|
||||
wide_path wpath (file);
|
||||
if (GetFileAttributesW (wpath) != (DWORD) - 1)
|
||||
|
|
Loading…
Reference in New Issue