1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-18 11:19:10 +00:00

Replace MemZero with memset.

This commit is contained in:
Darryl Pogue
2012-01-21 15:53:29 -08:00
committed by Adam Johnson
parent 7d7d7d273f
commit 72fdf8de32
8 changed files with 16 additions and 28 deletions

View File

@ -448,7 +448,7 @@ bool INtFileOpCompleteReadWrite (
if (!file->sectorSizeMask)
ErrorFatal(__LINE__, __FILE__, "Disk %s failed", op->opType == kOpFileRead ? "read" : "write");
if (op->opType == kOpFileRead)
MemZero(op->rw.buffer + bytes, op->win32Bytes - bytes);
memset(op->rw.buffer + bytes, 0, op->win32Bytes - bytes);
}
if (op->masterOp) {

View File

@ -548,7 +548,7 @@ static SOCKET ListenSocket (NetAddress * listenAddr) {
addr.sin_family = AF_INET;
addr.sin_port = htons((uint16_t)port);
addr.sin_addr.S_un.S_addr = htonl(node);
MemZero(addr.sin_zero, sizeof(addr.sin_zero));
memset(addr.sin_zero, 0, sizeof(addr.sin_zero));
if (bind(s, (sockaddr *) &addr, sizeof(addr))) {
wchar_t str[32];
NetAddressToString(*listenAddr, str, arrsize(str), kNetAddressFormatAll);
@ -632,7 +632,7 @@ static SOCKET ConnectSocket (unsigned localPort, const NetAddress & addr) {
addr.sin_family = AF_INET;
addr.sin_port = htons((uint16_t) localPort);
addr.sin_addr.S_un.S_addr = INADDR_ANY;
MemZero(addr.sin_zero, sizeof(addr.sin_zero));
memset(addr.sin_zero, 0, sizeof(addr.sin_zero));
if (bind(s, (sockaddr *) &addr, sizeof(addr))) {
LogMsg(kLogError, "bind(port %u) failed (%u)", localPort, WSAGetLastError());
break;

View File

@ -215,7 +215,7 @@ void CFile::Read (
// Handle errors
if (bytesRead != bytes)
MemZero((uint8_t *)buffer + bytesRead, bytes - bytesRead);
memset((uint8_t *)buffer + bytesRead, 0, bytes - bytesRead);
if ( (!result && (GetLastError() != ERROR_IO_PENDING)) ||
(bytesRead != bytes) )
LogMsg(kLogFatal, "failed: ReadFile");

View File

@ -110,7 +110,7 @@ static void LookupProcess (Lookup * lookup, unsigned error) {
// allocate a buffer large enough to hold all the addresses
addrs = (NetAddress *)malloc(sizeof(*addrs) * count);
MemZero(addrs, sizeof(*addrs) * count);
memset(addrs, 0, sizeof(*addrs) * count);
// fill in address data
const uint16_t port = htons((uint16_t) lookup->port);