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
parent 238c2b14ca
commit 9beb7b9771

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;
}