From 63e8da5abeaad1d2aa332fc41ad8f161fc567cdf Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 21 May 2010 16:14:07 +0100 Subject: [PATCH] C99 compatible build fix for RHEL 5. --- src/generator.ml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/generator.ml b/src/generator.ml index 95a2637..d2da8ec 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -11035,9 +11035,12 @@ print_strings (char *const *argv) | FileIn n | FileOut n -> pr " printf (\"%%s\\n\", %s);\n" n | BufferIn n -> - pr " for (size_t i = 0; i < %s_size; ++i)\n" n; - pr " printf (\"<%%02x>\", %s[i]);\n" n; - pr " printf (\"\\n\");\n" + pr " {\n"; + pr " size_t i;\n"; + pr " for (i = 0; i < %s_size; ++i)\n" n; + pr " printf (\"<%%02x>\", %s[i]);\n" n; + pr " printf (\"\\n\");\n"; + pr " }\n"; | OptString n -> pr " printf (\"%%s\\n\", %s ? %s : \"null\");\n" n n | StringList n | DeviceList n -> pr " print_strings (%s);\n" n | Bool n -> pr " printf (\"%%s\\n\", %s ? \"true\" : \"false\");\n" n -- 1.8.3.1