aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2020-08-07 13:30:40 +0200
committerCorinna Vinschen <corinna@vinschen.de>2020-08-07 15:09:48 +0200
commit9beb7b977162bd576da325ce8e23152e70989f78 (patch)
treec2b3492771e9de04a191d22c7d9608bdad8bf144
parent238c2b14ca3cd7cc785e67846cce63380b4679ae (diff)
downloadnewlib-9beb7b977162bd576da325ce8e23152e70989f78.zip
newlib-9beb7b977162bd576da325ce8e23152e70989f78.tar.gz
newlib-9beb7b977162bd576da325ce8e23152e70989f78.tar.bz2
Cygwin: utils: cygcheck: avoid GCC warning concatenating strings
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
-rw-r--r--winsup/utils/dump_setup.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/winsup/utils/dump_setup.cc b/winsup/utils/dump_setup.cc
index 4415954..ec70da0 100644
--- a/winsup/utils/dump_setup.cc
+++ b/winsup/utils/dump_setup.cc
@@ -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;
}