diff --git a/lib/cgo/tests/testutils/libsky_assert.c b/lib/cgo/tests/testutils/libsky_assert.c index aaa3ecca1..d41cc44c9 100644 --- a/lib/cgo/tests/testutils/libsky_assert.c +++ b/lib/cgo/tests/testutils/libsky_assert.c @@ -58,13 +58,14 @@ GoInt_ isSigEq(cipher__Sig *sig1, cipher__Sig *sig2) { return memcmp((void *)sig1, (void *)sig2, sizeof(cipher__Sig)) == 0; } -GoInt_ isU8Eq(unsigned char p1[], unsigned char p2[], size_t len) { - - if (strncmp(p1, p2, len) == 0) { - +GoInt_ isU8Eq(unsigned char p1[], unsigned char p2[], size_t len) +{ + for (GoInt i = 0; i < len; i++) { + if (p1[i] != p2[i]) { + return 0; + } + } return 1; - } - return 0; } GoInt_ isSHA256Eq(cipher__SHA256 *sh1, cipher__SHA256 *sh2) {