make lua string to number conversion consistent between platforms
effectively clamps it to 32bit range maybe fixes some issues between windows and other builds
This commit is contained in:
1 parent
ea61c7d357
commit
8f762e0617
1 file changed
+2
-1
+2
-1
@@ -18,6 +18,7 @@
|
||||
#define INT32 int32_t
|
||||
#endif
|
||||
|
||||
#include "../doomdef.h"
|
||||
|
||||
/*
|
||||
** ==================================================================
|
||||
@@ -534,7 +535,7 @@
|
||||
#endif
|
||||
#define lua_number2str(s,n) sprintf((s), LUA_NUMBER_FMT, (n))
|
||||
#define LUAI_MAXNUMBER2STR 12 /* 10 digits, sign, and \0 */
|
||||
#define lua_str2number(s,p) strtol((s), (p), 10)
|
||||
#define lua_str2number(s,p) max(INT32_MIN, min((strtol((s), (p), 10)), INT32_MAX));
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Reference in new issue
Block a user