diff --git a/examples/app/asyncutils.nim b/examples/app/asyncutils.nim index 30a716e..6b510d7 100644 --- a/examples/app/asyncutils.nim +++ b/examples/app/asyncutils.nim @@ -74,7 +74,7 @@ proc asyncRecvMsg*(fd: AsyncFD, size: int = BufferSize, var cmsg = ControlMessage(level: cmsgHeader.cmsg_level, msgType: cmsgHeader.cmsg_type, data: newString(dataLen)) - copyMem(cmsg.data.cstring, CMSG_DATA(cmsgHeader), cmsgHeader.cmsg_len) + copyMem(cmsg.data.cstring, CMSG_DATA(cmsgHeader), dataLen) cmsgs.add(cmsg) cmsgHeader = CMSG_NXTHDR(addr msg, cmsgHeader)