summaryrefslogtreecommitdiffhomepage
path: root/lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib.c b/lib.c
index 5733646..80c1386 100644
--- a/lib.c
+++ b/lib.c
@@ -888,7 +888,7 @@ uc_splice(uc_vm *vm, size_t nargs)
if (remlen < 0)
remlen = 0;
}
- else if ((uint64_t)remlen > arrlen - ofs) {
+ else if ((uint64_t)remlen > arrlen - (uint64_t)ofs) {
remlen = arrlen - ofs;
}
@@ -1025,7 +1025,7 @@ uc_substr(uc_vm *vm, size_t nargs)
if (sublen < 0)
sublen = 0;
}
- else if ((uint64_t)sublen > len - ofs) {
+ else if ((uint64_t)sublen > len - (uint64_t)ofs) {
sublen = len - ofs;
}