diff --git a/ffprobe.c b/ffprobe.c
index e0d015651cc6e632067c9f4cbc1ca68808d22b76..a76e98ee453e16d5d59363bd6a7710549fd58c50 100644
--- 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)
 {