diff options
Diffstat (limited to 'libbcachefs/varint.c')
-rw-r--r-- | libbcachefs/varint.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libbcachefs/varint.c b/libbcachefs/varint.c index 6a78553d..6620ecae 100644 --- a/libbcachefs/varint.c +++ b/libbcachefs/varint.c @@ -9,6 +9,7 @@ #include <valgrind/memcheck.h> #endif +#include "errcode.h" #include "varint.h" /** @@ -53,7 +54,7 @@ int bch2_varint_decode(const u8 *in, const u8 *end, u64 *out) u64 v; if (unlikely(in + bytes > end)) - return -1; + return -BCH_ERR_varint_decode_error; if (likely(bytes < 9)) { __le64 v_le = 0; @@ -115,7 +116,7 @@ int bch2_varint_decode_fast(const u8 *in, const u8 *end, u64 *out) unsigned bytes = ffz(*in) + 1; if (unlikely(in + bytes > end)) - return -1; + return -BCH_ERR_varint_decode_error; if (likely(bytes < 9)) { v >>= bytes; |