]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
qemu-img: avoid preprocessor directives in a printf call
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 4 Feb 2010 15:49:56 +0000 (16:49 +0100)
committermalc <av1474@comtv.ru>
Mon, 8 Feb 2010 09:12:40 +0000 (12:12 +0300)
Other choices include using "(printf)", but this one is not bad in
terms of readability.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: malc <av1474@comtv.ru>
qemu-img.c

index cbba4fc790030a7fcbba0bdadc37e74e51012098..eb5c0f020713f538e33ce07564e4989844638b62 100644 (file)
@@ -58,7 +58,8 @@ static void format_print(void *opaque, const char *name)
 /* Please keep in synch with qemu-img.texi */
 static void help(void)
 {
-    printf("qemu-img version " QEMU_VERSION ", Copyright (c) 2004-2008 Fabrice Bellard\n"
+    const char *help_msg =
+           "qemu-img version " QEMU_VERSION ", Copyright (c) 2004-2008 Fabrice Bellard\n"
            "usage: qemu-img command [command options]\n"
            "QEMU disk image utility\n"
            "\n"
@@ -91,9 +92,9 @@ static void help(void)
            "  '-a' applies a snapshot (revert disk to saved state)\n"
            "  '-c' creates a snapshot\n"
            "  '-d' deletes a snapshot\n"
-           "  '-l' lists all snapshots in the given image\n"
-           );
-    printf("\nSupported formats:");
+           "  '-l' lists all snapshots in the given image\n";
+
+    printf("%s\nSupported formats:", help_msg);
     bdrv_iterate_format(format_print, NULL);
     printf("\n");
     exit(1);