More %i vs %d cleanup
authortb <tb@openbsd.org>
Fri, 10 Jun 2022 22:00:15 +0000 (22:00 +0000)
committertb <tb@openbsd.org>
Fri, 10 Jun 2022 22:00:15 +0000 (22:00 +0000)
regress/lib/libssl/buffer/buffertest.c
regress/lib/libssl/client/clienttest.c
regress/lib/libssl/record/recordtest.c
regress/lib/libssl/record_layer/record_layer_test.c
regress/lib/libssl/server/servertest.c
regress/lib/libssl/tlslegacy/tlslegacytest.c
regress/lib/libssl/unit/tls_prf.c

index 80b3b98..45742de 100644 (file)
@@ -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;
                }
index 754fe3a..be508bc 100644 (file)
@@ -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 <jsing@openbsd.org>
  *
@@ -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);
index c345a68..de9bfd6 100644 (file)
@@ -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 <jsing@openbsd.org>
  *
@@ -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;
                }
index 4e75ba4..95f13b8 100644 (file)
@@ -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 <jsing@openbsd.org>
  *
@@ -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;
        }
index bd0adcd..3367836 100644 (file)
@@ -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 <jsing@openbsd.org>
  *
@@ -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) {
index 17e1944..f18b0ee 100644 (file)
@@ -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 <jsing@openbsd.org>
  *
@@ -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) {
index fe6f5c8..bf0de1f 100644 (file)
@@ -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 <jsing@openbsd.org>
  *
@@ -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");