From: Richard W.M. Jones Date: Fri, 21 May 2010 15:14:07 +0000 (+0100) Subject: C99 compatible build fix for RHEL 5. X-Git-Tag: 1.3.14~5 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=63e8da5abeaad1d2aa332fc41ad8f161fc567cdf;p=libguestfs.git C99 compatible build fix for RHEL 5. --- 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