diff options
author | bptato <nincsnevem662@gmail.com> | 2023-12-02 10:30:51 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-12-02 10:59:29 +0100 |
commit | b91b64a2d54404c4ead09093c25e0002fbab1881 (patch) | |
tree | 69edf428260a7afb212fd4e016b08cab39a6e669 /lib/quickjs/quickjs.c | |
parent | c9588388d04bb3180c3cfec4359462421c0407f0 (diff) | |
download | chawan-b91b64a2d54404c4ead09093c25e0002fbab1881.tar.gz |
qjs: fix a warning
We want to check if d is larger than INT64_MAX, but the conversion rounds it up, so we actually need to use greater-equals.
Diffstat (limited to 'lib/quickjs/quickjs.c')
-rw-r--r-- | lib/quickjs/quickjs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/quickjs/quickjs.c b/lib/quickjs/quickjs.c index aea545a6..4fd42aac 100644 --- a/lib/quickjs/quickjs.c +++ b/lib/quickjs/quickjs.c @@ -10846,7 +10846,7 @@ static int JS_ToInt64SatFree(JSContext *ctx, int64_t *pres, JSValue val) } else { if (d < INT64_MIN) *pres = INT64_MIN; - else if (d > INT64_MAX) + else if (d >= (double)INT64_MAX) *pres = INT64_MAX; else *pres = (int64_t)d; |