Cygwin: utils: cygcheck: avoid GCC warning concatenating strings

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2020-08-07 13:30:40 +02:00 committed by Ken Brown
parent 835865603d
commit 03beadd4eb
1 changed files with 5 additions and 1 deletions

View File

@ -77,11 +77,15 @@ parse_filename (const char *in_fn, fileparse& f)
else if (strcasecmp (ver, "-src") == 0 ||
strcasecmp (ver, "-patch") == 0)
{
size_t len;
*ver++ = '\0';
strcpy (f.pkg, p);
strcpy (f.what, strlwr (ver));
strcpy (f.pkgtar, p);
strcat (f.pkgtar, f.tail);
len = strlen (f.pkgtar);
strncpy (f.pkgtar + len, f.tail, sizeof (f.pkgtar) - len);
f.pkgtar[MAX_PATH] = '\0';
ver = strchr (ver, '\0');
break;
}