summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2019-12-12 17:36:46 -0800
committerElliott Hughes <enh@google.com>2019-12-12 17:36:46 -0800
commit4c58332de840593b489e8b6758d1004943171292 (patch)
treeb150a05f26f05d32f7e7d4892ae33e8ae717d6d9
parentab7d77d861caea4f4dca0392eea25a316c328cd6 (diff)
downloadgdb-4c58332de840593b489e8b6758d1004943171292.tar.gz
Go back to snprintf rather than strlcpy.
ChromeOS uses the same copy of the gdb source, and glibc doesn't have strlcpy. snprintf is what we used historically anyway. Bug: http://b/146175305 Test: treehugger Change-Id: If048bc5baf5353690b29d78347e425f9f48afcd4
-rw-r--r--gdb-8.3/gdb/gdbserver/remote-utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb-8.3/gdb/gdbserver/remote-utils.c b/gdb-8.3/gdb/gdbserver/remote-utils.c
index 70c514a0d..d32ad4287 100644
--- a/gdb-8.3/gdb/gdbserver/remote-utils.c
+++ b/gdb-8.3/gdb/gdbserver/remote-utils.c
@@ -364,7 +364,7 @@ remote_open (const char *name)
memset (&sockaddr, 0, sizeof sockaddr);
sockaddr.sun_family = AF_UNIX;
- strlcpy (sockaddr.sun_path, name, sizeof (sockaddr.sun_path));
+ snprintf (sockaddr.sun_path, sizeof (sockaddr.sun_path), "%s", name);
sockaddrlen = sizeof (sockaddr.sun_family) +
strlen (sockaddr.sun_path) + 1;