aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/parse_module.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/parse_module.c b/tools/parse_module.c
index 85540af..c9a5b12 100644
--- a/tools/parse_module.c
+++ b/tools/parse_module.c
@@ -34,7 +34,7 @@ int leb_u32(FILE *handle, uint32_t *result)
return -1;
}
- if (encoded[i] >= 0)
+ if (encoded[i] < 128)
break;
if (i == 4) {
@@ -46,7 +46,7 @@ int leb_u32(FILE *handle, uint32_t *result)
decoded = 0;
for (j = i; j >= 0; j--)
- decoded = (decoded << 7) | (encoded[i] & 0x7F);
+ decoded = (decoded << 7) | (encoded[j] & 0x7F);
if (decoded > UINT32_MAX) {
PRERR(MSG_BAD_NUM_ENC);