guestfish: Fix printing of buffers in structs.
authorRichard Jones <rjones@redhat.com>
Sat, 31 Oct 2009 13:40:12 +0000 (13:40 +0000)
committerRichard Jones <rjones@redhat.com>
Mon, 2 Nov 2009 16:02:06 +0000 (16:02 +0000)
Somehow an 'indent' string crept in there, so it was printing:

  <char><indent><char><indent><char>...

instead of:

  <char><char><char>...

src/generator.ml

index 2cabd4a..b17ee65 100755 (executable)
@@ -6289,9 +6289,9 @@ and generate_fish_cmds () =
             pr "  printf (\"%%s%s: \", indent);\n" name;
             pr "  for (i = 0; i < %s->%s_len; ++i)\n" typ name;
             pr "    if (c_isprint (%s->%s[i]))\n" typ name;
-            pr "      printf (\"%%s%%c\", indent, %s->%s[i]);\n" typ name;
+            pr "      printf (\"%%c\", %s->%s[i]);\n" typ name;
             pr "    else\n";
-            pr "      printf (\"%%s\\\\x%%02x\", indent, %s->%s[i]);\n" typ name;
+            pr "      printf (\"\\\\x%%02x\", %s->%s[i]);\n" typ name;
             pr "  printf (\"\\n\");\n"
         | name, (FUInt64|FBytes) ->
             pr "  printf (\"%%s%s: %%\" PRIu64 \"\\n\", indent, %s->%s);\n"