]> git.tdb.fi Git - libs/net.git/commitdiff
Use a typecast to avoid a signedness mismatch warning
authorMikko Rasa <tdb@tdb.fi>
Thu, 19 Nov 2015 08:17:18 +0000 (10:17 +0200)
committerMikko Rasa <tdb@tdb.fi>
Thu, 19 Nov 2015 08:17:18 +0000 (10:17 +0200)
source/net/unix.cpp

index 373b65af6d3d5f0b340ca5590f9685c21ab3e238..cd1f41429e1c52f0cbd9f72559f9bc734b1c1be4 100644 (file)
@@ -26,7 +26,7 @@ UnixAddr::UnixAddr(const SysAddr &sa):
        throw logic_error("no unix sockets on windows");
 #else
        const sockaddr_un &sau = reinterpret_cast<const sockaddr_un &>(sa.addr);
-       if(sa.size>sizeof(sa_family_t))
+       if(static_cast<size_t>(sa.size)>sizeof(sa_family_t))
        {
                abstract = (sau.sun_path[0]==0);
                path.assign(sau.sun_path+abstract, sa.size-sizeof(sa_family_t)-abstract);