Add hex comparison function
This commit is contained in:
parent
0574632b30
commit
3499a9e41b
@ -441,3 +441,23 @@ static void test_fail( const char *test, int line_no, const char* filename )
|
||||
test_info.line_no = line_no;
|
||||
test_info.filename = filename;
|
||||
}
|
||||
|
||||
int hexcmp( uint8_t * a, uint8_t * b, uint32_t a_len, uint32_t b_len)
|
||||
{
|
||||
int ret = 0;
|
||||
uint32_t i = 0;
|
||||
|
||||
if ( a_len != b_len )
|
||||
return( a_len - b_len );
|
||||
|
||||
for( i = 0; i < a_len; i++ )
|
||||
{
|
||||
if ( a[i] != b[i] )
|
||||
{
|
||||
ret = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user