From: Dmitry Volyntsev Date: Thu, 10 Oct 2024 23:33:13 +0000 (-0700) Subject: Fixed Buffer.prototype.indexOf() on 32bits platforms. X-Git-Tag: 0.8.7~9 X-Git-Url: http://www.kaiwu.me/postgresql/commit/static/gitweb.js?a=commitdiff_plain;h=6902aaa17d8a2f30c44f2ed0ed165605233a2c6d;p=njs.git Fixed Buffer.prototype.indexOf() on 32bits platforms. --- diff --git a/src/njs_buffer.c b/src/njs_buffer.c index 2f0fc620..3ce1b90a 100644 --- a/src/njs_buffer.c +++ b/src/njs_buffer.c @@ -2198,7 +2198,7 @@ encoding: } } else { - to -= str.length - 1; + to -= (int64_t) str.length - 1; if (from > to) { goto done; diff --git a/src/qjs_buffer.c b/src/qjs_buffer.c index 02618387..9f451e26 100644 --- a/src/qjs_buffer.c +++ b/src/qjs_buffer.c @@ -1071,7 +1071,7 @@ encoding: } } else { - to -= str.length - 1; + to -= (int64_t) str.length - 1; if (from > to) { goto done;