File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -1157,9 +1157,10 @@ unixPathMax = #const sizeof(((struct sockaddr_un *)NULL)->sun_path)
1157
1157
pokeSockAddr :: Ptr a -> SockAddr -> IO ()
1158
1158
pokeSockAddr p sa@ (SockAddrUnix path) = do
1159
1159
let pathC = map castCharToCChar path
1160
- when (length pathC >= unixPathMax) $ error
1160
+ len = length pathC
1161
+ when (len >= unixPathMax) $ error
1161
1162
$ " pokeSockAddr: path is too long in SockAddrUnix " <> show path
1162
- <> " , length " <> show ( length path) <> " , unixPathMax " <> show unixPathMax
1163
+ <> " , length " <> show len <> " , unixPathMax " <> show unixPathMax
1163
1164
zeroMemory p $ fromIntegral $ sizeOfSockAddr sa
1164
1165
# if defined(HAVE_STRUCT_SOCKADDR_SA_LEN)
1165
1166
(# poke struct sockaddr_un, sun_len) p ((# const sizeof(struct sockaddr_un)) :: Word8 )
You can’t perform that action at this time.
0 commit comments