From 568dc27a1943305f6e11a9a497f56a6aabe27c99 Mon Sep 17 00:00:00 2001 From: nikkolasg Date: Fri, 17 Jun 2016 10:41:45 -0400 Subject: Make base16_decodes return number of decoded bytes base16_decodes() now returns the number of decoded bytes. It's interface changes from returning a "int" to a "ssize_t". Every callsite now checks the returned value. Fixes #14013 Signed-off-by: David Goulet --- src/or/routerlist.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/or/routerlist.c') diff --git a/src/or/routerlist.c b/src/or/routerlist.c index aaa8fad178..bdb3d490c7 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -2685,7 +2685,8 @@ hex_digest_nickname_decode(const char *hexdigest, return -1; } - if (base16_decode(digest_out, DIGEST_LEN, hexdigest, HEX_DIGEST_LEN)<0) + if (base16_decode(digest_out, DIGEST_LEN, + hexdigest, HEX_DIGEST_LEN) != DIGEST_LEN) return -1; return 0; } @@ -2770,7 +2771,7 @@ hexdigest_to_digest(const char *hexdigest, char *digest) if (hexdigest[0]=='$') ++hexdigest; if (strlen(hexdigest) < HEX_DIGEST_LEN || - base16_decode(digest,DIGEST_LEN,hexdigest,HEX_DIGEST_LEN) < 0) + base16_decode(digest,DIGEST_LEN,hexdigest,HEX_DIGEST_LEN) != DIGEST_LEN) return -1; return 0; } -- cgit v1.2.3-54-g00ecf