Now handling zeros in address correctly
This commit is contained in:
parent
4cbcf6be3d
commit
c96c1db14c
2 changed files with 5 additions and 7 deletions
|
@ -124,8 +124,10 @@ int test_multiaddr_bytes() {
|
||||||
|
|
||||||
result = multiaddress_new_from_bytes(orig->bytes, orig->bsize);
|
result = multiaddress_new_from_bytes(orig->bytes, orig->bsize);
|
||||||
|
|
||||||
if (strcmp(orig_address, result->string) != 0)
|
if (strcmp(orig_address, result->string) != 0) {
|
||||||
|
fprintf(stderr, "%s does not equal %s\n", orig_address, result->string);
|
||||||
goto exit;
|
goto exit;
|
||||||
|
}
|
||||||
|
|
||||||
retVal = 1;
|
retVal = 1;
|
||||||
exit:
|
exit:
|
||||||
|
|
|
@ -96,14 +96,10 @@ void vthconvert(int size, char * crrz01, const uint8_t * xbuf)
|
||||||
char conv_proc[800]="\0";
|
char conv_proc[800]="\0";
|
||||||
int i;
|
int i;
|
||||||
for(i=0; i < (size*2); i++)
|
for(i=0; i < (size*2); i++)
|
||||||
{
|
|
||||||
if(buf[i]!='\0')
|
|
||||||
{
|
{
|
||||||
sprintf (conv_proc, "%02X", buf[i]);
|
sprintf (conv_proc, "%02X", buf[i]);
|
||||||
//printf("%d:%d\n",i, buf[i]);
|
|
||||||
strcat(crrz1, conv_proc);
|
strcat(crrz1, conv_proc);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
crrz1 = NULL;
|
crrz1 = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue