ffprobe: use "%*" printf syntax in XML_INDENT() in place of a loop
authorStefano Sabatini <stefasab@gmail.com>
Sun, 8 Jan 2012 09:40:11 +0000 (10:40 +0100)
committerStefano Sabatini <stefasab@gmail.com>
Sun, 8 Jan 2012 10:19:27 +0000 (11:19 +0100)
Possibly faster/cleaner.

Suggested-By: Clément Bœsch <ubitux@gmail.com>
ffprobe.c

index e0d0156..a76e98e 100644 (file)
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -1032,7 +1032,7 @@ static void xml_print_footer(WriterContext *wctx)
     printf("</%sffprobe>\n", xml->fully_qualified ? "ffprobe:" : "");
 }
 
-#define XML_INDENT() { int i; for (i = 0; i < xml->indent_level; i++) printf(INDENT); }
+#define XML_INDENT() printf("%*c", xml->indent_level * 4, ' ')
 
 static void xml_print_chapter_header(WriterContext *wctx, const char *chapter)
 {