mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-06-12 17:14:46 +02:00
Fix Y2038 bug on Windows in unreal_setfilemodtime (PR #332)
Int32x32To64 macro internally truncates the arguments to int32, while time_t is 64-bit on most/all modern platforms. Therefore, usage of this macro creates a Year 2038 bug.
This commit is contained in:
+1
-1
@@ -1123,7 +1123,7 @@ void unreal_setfilemodtime(const char *filename, time_t mtime)
|
||||
FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
if (hFile == INVALID_HANDLE_VALUE)
|
||||
return;
|
||||
llValue = Int32x32To64(mtime, 10000000) + 116444736000000000;
|
||||
llValue = (mtime * 10000000LL) + 116444736000000000LL;
|
||||
mTime.dwLowDateTime = (long)llValue;
|
||||
mTime.dwHighDateTime = llValue >> 32;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user