From e37f280f2c7800d38f1e02a20ef4c85c1f8104d0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 9 Nov 2016 13:14:45 -0300 Subject: [PATCH] test --- src/komodo_utils.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/komodo_utils.h b/src/komodo_utils.h index fdb210028..000648752 100644 --- a/src/komodo_utils.h +++ b/src/komodo_utils.h @@ -851,11 +851,13 @@ int32_t decode_hex(uint8_t *bytes,int32_t n,char *hex) { int32_t adjust,i = 0; //printf("decode.(%s)\n",hex); - if ( is_hexstr(hex,n) == 0 ) + if ( is_hexstr(hex,n) < 2 ) { memset(bytes,0,n); return(n); } + if ( hex[n-1] == '\n' || hex[n-1] == '\r' ) + n--; if ( n == 0 || (hex[n*2+1] == 0 && hex[n*2] != 0) ) { if ( n > 0 )