summaryrefslogtreecommitdiffhomepage
path: root/lib.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2021-04-26 14:16:25 +0200
committerJo-Philipp Wich <jo@mein.io>2021-04-26 16:10:53 +0200
commitd5dd183f3622002fbc4ae175045a3ebce4eeeb05 (patch)
tree4ae8cd1a084b937fa7bc5919c42fd5f67889c1ff /lib.c
parent28825acae8ee95543d4dc4f2c38e9711d4d4a420 (diff)
treewide: address various sign-compare warnings
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
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;
}