Fix off-by-one bug in #1108 fix
This commit is contained in:
1 parent
65cbaac344
commit
9df19f53e4
2 files changed
+3
-3
No files matched your search
@@ -297,7 +297,7 @@ static jv jvp_array_slice(jv a, int start, int end) {
|
||||
return jv_array();
|
||||
}
|
||||
|
||||
if (a.offset + start > 1 << (sizeof(a.offset) * CHAR_BIT)) {
|
||||
if (a.offset + start >= 1 << (sizeof(a.offset) * CHAR_BIT)) {
|
||||
jv r = jv_array_sized(end - start);
|
||||
for (int i = start; i < end; i++)
|
||||
r = jv_array_append(r, jv_array_get(jv_copy(a), i));
|
||||
|
||||
Reference in new issue
Block a user