jl777 8 years ago
parent
commit
ef14282450
  1. 4
      crypto777/iguana_utils.c

4
crypto777/iguana_utils.c

@ -359,11 +359,13 @@ int32_t decode_hex(unsigned char *bytes,int32_t n,char *hex)
{ {
int32_t adjust,i = 0; int32_t adjust,i = 0;
//printf("decode.(%s)\n",hex); //printf("decode.(%s)\n",hex);
if ( is_hexstr(hex,n) == 0 ) if ( is_hexstr(hex,n) < 2 )
{ {
memset(bytes,0,n); memset(bytes,0,n);
return(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 || (hex[n*2+1] == 0 && hex[n*2] != 0) )
{ {
if ( n > 0 ) if ( n > 0 )

Loading…
Cancel
Save