public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: utils: cygcheck: avoid GCC warning concatenating strings
@ 2020-08-07 13:16 Corinna Vinschen
0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2020-08-07 13:16 UTC (permalink / raw)
To: cygwin-cvs
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=9beb7b977162bd576da325ce8e23152e70989f78
commit 9beb7b977162bd576da325ce8e23152e70989f78
Author: Corinna Vinschen <corinna@vinschen.de>
Date: Fri Aug 7 13:30:40 2020 +0200
Cygwin: utils: cygcheck: avoid GCC warning concatenating strings
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diff:
---
winsup/utils/dump_setup.cc | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/winsup/utils/dump_setup.cc b/winsup/utils/dump_setup.cc
index 4415954f9..ec70da0db 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;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-08-07 13:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-07 13:16 [newlib-cygwin] Cygwin: utils: cygcheck: avoid GCC warning concatenating strings Corinna Vinschen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).