diff options
author | Björn-Egil Dahlberg <[email protected]> | 2013-02-22 16:42:40 +0100 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2013-02-22 17:22:45 +0100 |
commit | 2c6fc163c4d20f813c692f80ffe401e8bd810496 (patch) | |
tree | 30cc2caa573c1621378c549278ec9eba9827f38f /erts/emulator/drivers/win32 | |
parent | c8651ed773be1b8b222338c50f680a3164ce517c (diff) | |
download | otp-2c6fc163c4d20f813c692f80ffe401e8bd810496.tar.gz otp-2c6fc163c4d20f813c692f80ffe401e8bd810496.tar.bz2 otp-2c6fc163c4d20f813c692f80ffe401e8bd810496.zip |
erts: Use correct type for ReadFile bytes read
Using a 64bit type for bytes read will not always clear the higher bits.
Diffstat (limited to 'erts/emulator/drivers/win32')
-rw-r--r-- | erts/emulator/drivers/win32/win_efile.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/erts/emulator/drivers/win32/win_efile.c b/erts/emulator/drivers/win32/win_efile.c index f2b0c8a843..1059fa5c3a 100644 --- a/erts/emulator/drivers/win32/win_efile.c +++ b/erts/emulator/drivers/win32/win_efile.c @@ -1159,8 +1159,11 @@ char* buf; /* Buffer to read into. */ size_t count; /* Number of bytes to read. */ size_t* pBytesRead; /* Where to return number of bytes read. */ { - if (!ReadFile((HANDLE) fd, buf, count, (DWORD *) pBytesRead, NULL)) + DWORD nbytes = 0; + if (!ReadFile((HANDLE) fd, buf, count, &nbytes, NULL)) return set_error(errInfo); + + *pBytesRead = nbytes; return 1; } |