ccb6e0
commit 77536da3dea5af4d1859e4e754f07f47cf8d7d4c
ccb6e0
Author: Florian Weimer <fweimer@redhat.com>
ccb6e0
Date:   Fri Jun 24 19:38:14 2022 +0200
ccb6e0
ccb6e0
    resolv/tst-resolv-noaaaa: Support building for older C standards
ccb6e0
    
ccb6e0
    This avoids a compilation error:
ccb6e0
    
ccb6e0
    tst-resolv-noaaaa.c: In function 'response':
ccb6e0
    tst-resolv-noaaaa.c:74:11: error: a label can only be part of a statement and a declaration is not a statement
ccb6e0
               char ipv4[4] = {192, 0, 2, i + 1};
ccb6e0
               ^~~~
ccb6e0
    tst-resolv-noaaaa.c:79:11: error: a label can only be part of a statement and a declaration is not a statement
ccb6e0
               char *name = xasprintf ("ptr-%d", i);
ccb6e0
               ^~~~
ccb6e0
ccb6e0
diff --git a/resolv/tst-resolv-noaaaa.c b/resolv/tst-resolv-noaaaa.c
ccb6e0
index 56b25f88a58ad286..6e0c6b6fb809e245 100644
ccb6e0
--- a/resolv/tst-resolv-noaaaa.c
ccb6e0
+++ b/resolv/tst-resolv-noaaaa.c
ccb6e0
@@ -71,14 +71,18 @@ response (const struct resolv_response_context *ctx,
ccb6e0
       switch (qtype)
ccb6e0
         {
ccb6e0
         case T_A:
ccb6e0
-          char ipv4[4] = {192, 0, 2, i + 1};
ccb6e0
-          resolv_response_add_data (b, &ipv4, sizeof (ipv4));
ccb6e0
+          {
ccb6e0
+            char ipv4[4] = {192, 0, 2, i + 1};
ccb6e0
+            resolv_response_add_data (b, &ipv4, sizeof (ipv4));
ccb6e0
+          }
ccb6e0
           break;
ccb6e0
 
ccb6e0
         case T_PTR:
ccb6e0
-          char *name = xasprintf ("ptr-%d", i);
ccb6e0
-          resolv_response_add_name (b, name);
ccb6e0
-          free (name);
ccb6e0
+          {
ccb6e0
+            char *name = xasprintf ("ptr-%d", i);
ccb6e0
+            resolv_response_add_name (b, name);
ccb6e0
+            free (name);
ccb6e0
+          }
ccb6e0
           break;
ccb6e0
         }
ccb6e0
       resolv_response_close_record (b);