Skip to content

Commit

Permalink
Fix issues in crypto_test.c
Browse files Browse the repository at this point in the history
  • Loading branch information
jhert0 committed Jan 7, 2017
1 parent d6d14b5 commit d41bb3a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions auto_tests/crypto_test.c
Expand Up @@ -344,11 +344,14 @@ END_TEST

static int cmp(const void *a, const void *b)
{
if (a < b) {
const clock_t *first = (const clock_t *) a;
const clock_t *second = (const clock_t *) b;

if (*first < *second) {
return -1;
}

if (a > b) {
if (*first > *second) {
return 1;
}

Expand All @@ -371,7 +374,7 @@ static clock_t memcmp_median(void *a, void *b, size_t len)
results[i] = memcmp_time(a, b, len);
}

qsort(results, CRYPTO_TEST_MEMCMP_COUNT, sizeof(results), cmp);
qsort(results, CRYPTO_TEST_MEMCMP_COUNT, sizeof(*results), cmp);
return results[CRYPTO_TEST_MEMCMP_COUNT / 2];
}

Expand Down

0 comments on commit d41bb3a

Please sign in to comment.