From c0a6a244667a40f937c830ebe95ad69286382395 Mon Sep 17 00:00:00 2001 From: tb Date: Fri, 10 Jun 2022 22:00:15 +0000 Subject: [PATCH] More %i vs %d cleanup --- regress/lib/libssl/buffer/buffertest.c | 6 +++--- regress/lib/libssl/client/clienttest.c | 6 +++--- regress/lib/libssl/record/recordtest.c | 6 +++--- regress/lib/libssl/record_layer/record_layer_test.c | 6 +++--- regress/lib/libssl/server/servertest.c | 4 ++-- regress/lib/libssl/tlslegacy/tlslegacytest.c | 4 ++-- regress/lib/libssl/unit/tls_prf.c | 8 ++++---- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/regress/lib/libssl/buffer/buffertest.c b/regress/lib/libssl/buffer/buffertest.c index 80b3b98d685..45742dec4ea 100644 --- a/regress/lib/libssl/buffer/buffertest.c +++ b/regress/lib/libssl/buffer/buffertest.c @@ -122,15 +122,15 @@ main(int argc, char **argv) ret = tls_buffer_extend(buf, et->extend_len, read_cb, &rs); if (ret != extend_tests[i].want_ret) { - fprintf(stderr, "FAIL: Test %zi - extend returned %zi, " - "want %zi\n", i, ret, et->want_ret); + fprintf(stderr, "FAIL: Test %zd - extend returned %zd, " + "want %zd\n", i, ret, et->want_ret); return 1; } tls_buffer_cbs(buf, &cbs); if (!CBS_mem_equal(&cbs, testdata, CBS_len(&cbs))) { - fprintf(stderr, "FAIL: Test %zi - extend buffer " + fprintf(stderr, "FAIL: Test %zd - extend buffer " "mismatch", i); return 1; } diff --git a/regress/lib/libssl/client/clienttest.c b/regress/lib/libssl/client/clienttest.c index 754fe3ae6ed..be508bcf508 100644 --- a/regress/lib/libssl/client/clienttest.c +++ b/regress/lib/libssl/client/clienttest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clienttest.c,v 1.36 2021/11/20 16:32:55 tb Exp $ */ +/* $OpenBSD: clienttest.c,v 1.37 2022/06/10 22:00:15 tb Exp $ */ /* * Copyright (c) 2015 Joel Sing * @@ -628,7 +628,7 @@ client_hello_test(int testno, const struct client_hello_test *cht) int ret = 1; long len; - fprintf(stderr, "Test %i - %s\n", testno, cht->desc); + fprintf(stderr, "Test %d - %s\n", testno, cht->desc); /* Providing a small buf causes *_get_server_hello() to return. */ if ((rbio = BIO_new_mem_buf(rbuf, sizeof(rbuf))) == NULL) { @@ -668,7 +668,7 @@ client_hello_test(int testno, const struct client_hello_test *cht) errx(1, "failed to make client hello"); if ((size_t)len != client_hello_len) { - fprintf(stderr, "FAIL: test returned ClientHello length %li, " + fprintf(stderr, "FAIL: test returned ClientHello length %ld, " "want %zu\n", len, client_hello_len); fprintf(stderr, "received:\n"); hexdump(wbuf, len, NULL); diff --git a/regress/lib/libssl/record/recordtest.c b/regress/lib/libssl/record/recordtest.c index c345a68c159..de9bfd69354 100644 --- a/regress/lib/libssl/record/recordtest.c +++ b/regress/lib/libssl/record/recordtest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: recordtest.c,v 1.4 2020/05/11 18:08:37 jsing Exp $ */ +/* $OpenBSD: recordtest.c,v 1.5 2022/06/10 22:00:15 tb Exp $ */ /* * Copyright (c) 2019 Joel Sing * @@ -389,7 +389,7 @@ test_record_recv(size_t test_no, struct record_recv_test *rrt) ret = tls13_record_recv(rec, read_cb, &rs); if (ret != rrt->rt[i].want_ret) { fprintf(stderr, "FAIL: Test %zu/%zu - tls_record_recv " - "returned %zi, want %zi\n", test_no, i, ret, + "returned %zd, want %zd\n", test_no, i, ret, rrt->rt[i].want_ret); goto failure; } @@ -494,7 +494,7 @@ test_record_send(size_t test_no, struct record_send_test *rst) ret = tls13_record_send(rec, write_cb, &ws); if (ret != rst->rt[i].want_ret) { fprintf(stderr, "FAIL: Test %zu/%zu - tls_record_send " - "returned %zi, want %zi\n", test_no, i, ret, + "returned %zd, want %zd\n", test_no, i, ret, rst->rt[i].want_ret); goto failure; } diff --git a/regress/lib/libssl/record_layer/record_layer_test.c b/regress/lib/libssl/record_layer/record_layer_test.c index 4e75ba4a259..95f13b8cc73 100644 --- a/regress/lib/libssl/record_layer/record_layer_test.c +++ b/regress/lib/libssl/record_layer/record_layer_test.c @@ -1,4 +1,4 @@ -/* $OpenBSD: record_layer_test.c,v 1.4 2021/03/29 16:22:02 jsing Exp $ */ +/* $OpenBSD: record_layer_test.c,v 1.5 2022/06/10 22:00:15 tb Exp $ */ /* * Copyright (c) 2019, 2020 Joel Sing * @@ -211,7 +211,7 @@ do_seq_num_test_tls12(size_t test_no, int dtls, struct seq_num_test *snt) memcpy(seq_num, snt->seq_num, sizeof(seq_num)); if ((ret = tls12_record_layer_inc_seq_num(rl, seq_num)) != snt->want) { - fprintf(stderr, "FAIL: Test %zu - got return %i, want %i\n", + fprintf(stderr, "FAIL: Test %zu - got return %d, want %d\n", test_no, ret, snt->want); goto failure; } @@ -260,7 +260,7 @@ do_seq_num_test_tls13(size_t test_no, struct seq_num_test *snt) memcpy(seq_num, snt->seq_num, sizeof(seq_num)); if ((ret = tls13_record_layer_inc_seq_num(seq_num)) != snt->want) { - fprintf(stderr, "FAIL: Test %zu - got return %i, want %i\n", + fprintf(stderr, "FAIL: Test %zu - got return %d, want %d\n", test_no, ret, snt->want); goto failure; } diff --git a/regress/lib/libssl/server/servertest.c b/regress/lib/libssl/server/servertest.c index bd0adcd005c..3367836dbd2 100644 --- a/regress/lib/libssl/server/servertest.c +++ b/regress/lib/libssl/server/servertest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: servertest.c,v 1.6 2021/11/20 16:36:55 tb Exp $ */ +/* $OpenBSD: servertest.c,v 1.7 2022/06/10 22:00:15 tb Exp $ */ /* * Copyright (c) 2015, 2016, 2017 Joel Sing * @@ -116,7 +116,7 @@ server_hello_test(int testno, struct server_hello_test *sht) SSL *ssl = NULL; int ret = 1; - fprintf(stderr, "Test %i - %s\n", testno, sht->desc); + fprintf(stderr, "Test %d - %s\n", testno, sht->desc); if ((rbio = BIO_new_mem_buf(sht->client_hello, sht->client_hello_len)) == NULL) { diff --git a/regress/lib/libssl/tlslegacy/tlslegacytest.c b/regress/lib/libssl/tlslegacy/tlslegacytest.c index 17e19448d83..f18b0eeac38 100644 --- a/regress/lib/libssl/tlslegacy/tlslegacytest.c +++ b/regress/lib/libssl/tlslegacy/tlslegacytest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tlslegacytest.c,v 1.5 2021/11/20 16:36:55 tb Exp $ */ +/* $OpenBSD: tlslegacytest.c,v 1.6 2022/06/10 22:00:15 tb Exp $ */ /* * Copyright (c) 2015, 2016, 2017, 2020 Joel Sing * @@ -567,7 +567,7 @@ tlslegacy_client_test(int testno, struct tlslegacy_client_test *tct) SSL *ssl = NULL; int ret = 1; - fprintf(stderr, "Test %i - %s\n", testno, tct->desc); + fprintf(stderr, "Test %d - %s\n", testno, tct->desc); if ((rbio = BIO_new_mem_buf(tct->server_response, tct->server_response_len)) == NULL) { diff --git a/regress/lib/libssl/unit/tls_prf.c b/regress/lib/libssl/unit/tls_prf.c index fe6f5c835d5..bf0de1f044a 100644 --- a/regress/lib/libssl/unit/tls_prf.c +++ b/regress/lib/libssl/unit/tls_prf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tls_prf.c,v 1.6 2022/02/06 09:19:46 anton Exp $ */ +/* $OpenBSD: tls_prf.c,v 1.7 2022/06/10 22:00:15 tb Exp $ */ /* * Copyright (c) 2017 Joel Sing * @@ -182,7 +182,7 @@ do_tls_prf_test(int test_no, struct tls_prf_test *tpt) int failure = 1; int len; - fprintf(stderr, "Test %i - %s\n", test_no, tpt->desc); + fprintf(stderr, "Test %d - %s\n", test_no, tpt->desc); if ((out = malloc(TLS_PRF_OUT_LEN)) == NULL) errx(1, "failed to allocate out"); @@ -207,14 +207,14 @@ do_tls_prf_test(int test_no, struct tls_prf_test *tpt) sizeof(TLS_PRF_SEED2), TLS_PRF_SEED3, sizeof(TLS_PRF_SEED3), TLS_PRF_SEED4, sizeof(TLS_PRF_SEED4), TLS_PRF_SEED5, sizeof(TLS_PRF_SEED5), out, len) != 1) { - fprintf(stderr, "FAIL: tls_PRF failed for len %i\n", + fprintf(stderr, "FAIL: tls_PRF failed for len %d\n", len); goto failure; } if (memcmp(out, tpt->out, len) != 0) { fprintf(stderr, "FAIL: tls_PRF output differs for " - "len %i\n", len); + "len %d\n", len); fprintf(stderr, "output:\n"); hexdump(out, TLS_PRF_OUT_LEN); fprintf(stderr, "test data:\n"); -- 2.20.1