summaryrefslogtreecommitdiff
path: root/lib/server
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2008-10-26 23:36:44 +0000
committerChris Wilson <chris+github@qwirx.com>2008-10-26 23:36:44 +0000
commitb3f8f4e3c840369478e7ad7667297ba3455e19a8 (patch)
treed672a4ae028f394d42e2d23b49674b56bdc6c91d /lib/server
parent0c61264ce01b854b9a863ac8a942465a1a94f7f8 (diff)
Silence warnings from openbsd gcc by using strncpy instead of strcpy.
Diffstat (limited to 'lib/server')
-rw-r--r--lib/server/Socket.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/server/Socket.cpp b/lib/server/Socket.cpp
index a450cd93..72c126a8 100644
--- a/lib/server/Socket.cpp
+++ b/lib/server/Socket.cpp
@@ -92,7 +92,9 @@ void Socket::NameLookupToSockAddr(SocketAllAddr &addr, int &sockDomain,
addr.sa_unix.sun_len = sockAddrLen;
#endif
addr.sa_unix.sun_family = PF_UNIX;
- ::strcpy(addr.sa_unix.sun_path, rName.c_str());
+ ::strncpy(addr.sa_unix.sun_path, rName.c_str(),
+ sizeof(addr.sa_unix.sun_path) - 1);
+ addr.sa_unix.sun_path[sizeof(addr.sa_unix.sun_path)-1] = 0;
}
break;
#endif