mirror of
https://github.com/janet-lang/janet
synced 2025-10-26 05:07:41 +00:00
Fix #505 - bat int64 parsing.
Fixes an off-by-1 error. Also makes windows testing hopefully a bit less flaky.
This commit is contained in:
@@ -447,7 +447,7 @@ int janet_scan_int64(const uint8_t *str, int32_t len, int64_t *out) {
|
||||
int neg;
|
||||
uint64_t bi;
|
||||
if (scan_uint64(str, len, &bi, &neg)) {
|
||||
if (neg && bi <= (UINT64_MAX / 2)) {
|
||||
if (neg && bi <= ((UINT64_MAX / 2) + 1)) {
|
||||
if (bi > INT64_MAX) {
|
||||
*out = INT64_MIN;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user