summaryrefslogtreecommitdiff
path: root/core/src/fxcrt/fx_extension.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/fxcrt/fx_extension.cpp')
-rw-r--r--core/src/fxcrt/fx_extension.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/core/src/fxcrt/fx_extension.cpp b/core/src/fxcrt/fx_extension.cpp
index 456e6bd7f3..31f645ae0f 100644
--- a/core/src/fxcrt/fx_extension.cpp
+++ b/core/src/fxcrt/fx_extension.cpp
@@ -332,9 +332,12 @@ void FX_Random_GenerateBase(FX_DWORD* pBuffer, int32_t iCount) {
FX_HashCode_String_GetA((const FX_CHAR*)&st2, sizeof(st2), TRUE);
::srand((dwHash1 << 16) | (FX_DWORD)dwHash2);
#else
- time_t tmLast = time(NULL), tmCur;
- while ((tmCur = time(NULL)) == tmLast)
- ;
+ time_t tmLast = time(NULL);
+ time_t tmCur;
+ while ((tmCur = time(NULL)) == tmLast) {
+ continue;
+ }
+
::srand((tmCur << 16) | (tmLast & 0xFFFF));
#endif
while (iCount-- > 0) {