summaryrefslogtreecommitdiff
path: root/auto_tests
diff options
context:
space:
mode:
authorendoffile78 <endoffile78@yahoo.com>2017-01-07 11:38:31 -0600
committerendoffile78 <endoffile78@yahoo.com>2017-01-07 11:47:31 -0600
commitd41bb3a8d48b3acba6a5191cf72a7c577b8e1ea8 (patch)
tree44c66f91309f531b9dba737d9151f88236416b40 /auto_tests
parentd6d14b54308b76bb5e7f47abd0c0b5757f1d9eb2 (diff)
Fix issues in crypto_test.c
Diffstat (limited to 'auto_tests')
-rw-r--r--auto_tests/crypto_test.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/auto_tests/crypto_test.c b/auto_tests/crypto_test.c
index e433833e..57a2a43b 100644
--- a/auto_tests/crypto_test.c
+++ b/auto_tests/crypto_test.c
@@ -344,11 +344,14 @@ END_TEST
344 344
345static int cmp(const void *a, const void *b) 345static int cmp(const void *a, const void *b)
346{ 346{
347 if (a < b) { 347 const clock_t *first = (const clock_t *) a;
348 const clock_t *second = (const clock_t *) b;
349
350 if (*first < *second) {
348 return -1; 351 return -1;
349 } 352 }
350 353
351 if (a > b) { 354 if (*first > *second) {
352 return 1; 355 return 1;
353 } 356 }
354 357
@@ -371,7 +374,7 @@ static clock_t memcmp_median(void *a, void *b, size_t len)
371 results[i] = memcmp_time(a, b, len); 374 results[i] = memcmp_time(a, b, len);
372 } 375 }
373 376
374 qsort(results, CRYPTO_TEST_MEMCMP_COUNT, sizeof(results), cmp); 377 qsort(results, CRYPTO_TEST_MEMCMP_COUNT, sizeof(*results), cmp);
375 return results[CRYPTO_TEST_MEMCMP_COUNT / 2]; 378 return results[CRYPTO_TEST_MEMCMP_COUNT / 2];
376} 379}
377 380