From 1262d853ef59a55262b6cb138be030d9e97ebc79 Mon Sep 17 00:00:00 2001 From: Thomas Jarosch Date: Tue, 2 Feb 2010 22:14:43 +0100 Subject: [PATCH] PC-lint: Silence warning about buffer possible overflow - we do this by design :) --- asyncio/async_socket.cpp | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/asyncio/async_socket.cpp b/asyncio/async_socket.cpp index 3e477d4..0e39394 100644 --- a/asyncio/async_socket.cpp +++ b/asyncio/async_socket.cpp @@ -261,8 +261,8 @@ bool UnixIOSocket::open(const std::string& path) { MegaAddr addr; addr.m_addr_un.sun_family= AF_UNIX; - strncpy(addr.m_addr_un.sun_path, path.c_str(), PATH_MAX); - if (::connect(fd,(sockaddr*)&addr.m_addr_un, SUN_LEN(&addr.m_addr_un)) < 0) + strncpy(addr.m_addr_un.sun_path, path.c_str(), PATH_MAX); //lint !e419 + if (::connect(fd,(sockaddr*)&addr.m_addr_un, SUN_LEN(&addr.m_addr_un)) < 0) //lint !e413 { m_errno= errno; ::close(fd); @@ -354,12 +354,12 @@ bool UnixServerSocketBase::open(const std::string& path, int mode) { MegaAddr addr; addr.m_addr_un.sun_family= AF_UNIX; - strncpy(addr.m_addr_un.sun_path, path.c_str(), PATH_MAX); + strncpy(addr.m_addr_un.sun_path, path.c_str(), PATH_MAX); //lint !e419 Utils::unlink(path); // just in case... // NOTE this is a place which might require some updates for multithreaded // usage! (setting the umask affects all threads...) mode_t old_mask= ::umask( (mode & 0777) ^ 0777); - if (::bind(fd,(sockaddr*)&addr.m_addr_un, SUN_LEN(&addr.m_addr_un)) < 0) + if (::bind(fd,(sockaddr*)&addr.m_addr_un, SUN_LEN(&addr.m_addr_un)) < 0) //lint !e413 { m_errno= errno; ::umask(old_mask); -- 1.7.1