diff options
author | Chris Wilson <chris+github@qwirx.com> | 2008-10-26 23:36:44 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2008-10-26 23:36:44 +0000 |
commit | b3f8f4e3c840369478e7ad7667297ba3455e19a8 (patch) | |
tree | d672a4ae028f394d42e2d23b49674b56bdc6c91d /lib/server/Socket.cpp | |
parent | 0c61264ce01b854b9a863ac8a942465a1a94f7f8 (diff) |
Silence warnings from openbsd gcc by using strncpy instead of strcpy.
Diffstat (limited to 'lib/server/Socket.cpp')
-rw-r--r-- | lib/server/Socket.cpp | 4 |
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 |