Add hex comparison function

This commit is contained in:
Azim Khan 2017-05-30 00:06:49 +01:00 committed by Mohammad Azim Khan
parent 0574632b30
commit 3499a9e41b

View file

@ -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;
}