Fix sparc64 build/run
authorkn <kn@openbsd.org>
Wed, 23 Nov 2022 23:06:16 +0000 (23:06 +0000)
committerkn <kn@openbsd.org>
Wed, 23 Nov 2022 23:06:16 +0000 (23:06 +0000)
constraints.c:269: warning: ISO C90 forbids mixed declarations and code

from tb

regress/lib/libcrypto/x509/constraints.c

index 933c4f4..d3fdf0e 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: constraints.c,v 1.13 2022/11/11 12:02:34 beck Exp $   */
+/*     $OpenBSD: constraints.c,v 1.14 2022/11/23 23:06:16 kn Exp $     */
 /*
  * Copyright (c) 2020 Bob Beck <beck@openbsd.org>
  *
@@ -254,9 +254,9 @@ test_invalid_hostnames(void)
 {
        int i, failure = 0;
        char *nulhost = "www.openbsd.org\0";
+       CBS cbs;
 
        for (i = 0; invalid_hostnames[i] != NULL; i++) {
-               CBS cbs;
                CBS_init(&cbs, invalid_hostnames[i],
                    strlen(invalid_hostnames[i]));
                if (x509_constraints_valid_host(&cbs)) {
@@ -266,7 +266,6 @@ test_invalid_hostnames(void)
                        goto done;
                }
        }
-       CBS cbs;
        CBS_init(&cbs, nulhost, strlen(nulhost) + 1);
        if (x509_constraints_valid_host(&cbs)) {
                FAIL("hostname with NUL byte accepted\n");