Skip to content

Commit bd9e97f

Browse files
authored
Merge pull request #6 from PQCMayo/fix-calloc-transposed-args
Test code: fix wrong order in calloc call (-Wcalloc-transposed-args)
2 parents cad1ed8 + 751aaf6 commit bd9e97f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

apps/example.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ static int example_mayo(const mayo_params_t* p) {
3131
unsigned char *sk = calloc(p->csk_bytes, 1);
3232

3333
unsigned char *epk = calloc(p->epk_bytes, 1);
34-
sk_t *esk = calloc(sizeof(sk_t), 1);
34+
sk_t *esk = calloc(1, sizeof(sk_t));
3535

3636
unsigned char *sig = calloc(p->sig_bytes + msglen, 1);
3737

test/bench.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ static int bench_sig(const mayo_params_t *p, int runs, int csv) {
9999
unsigned char *pk = calloc(p->cpk_bytes, 1);
100100
unsigned char *epk = calloc(p->epk_bytes, 1);
101101
unsigned char *sk = calloc(p->csk_bytes, 1);
102-
sk_t *esk = (sk_t *)calloc(sizeof(sk_t), 1);
102+
sk_t *esk = (sk_t *)calloc(1, sizeof(sk_t));
103103
unsigned char *sig = calloc(p->sig_bytes + m_len, 1);
104104
unsigned char *m = calloc(m_len, 1);
105105
unsigned long long len = p->sig_bytes;

0 commit comments

Comments
 (0)