PC-lint: Silence warning about buffer possible overflow - we do this by design :)
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Tue, 2 Feb 2010 21:14:43 +0000 (22:14 +0100)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Tue, 2 Feb 2010 21:14:43 +0000 (22:14 +0100)
asyncio/async_socket.cpp

index 3e477d4..0e39394 100644 (file)
@@ -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);