]> xenbits.xensource.com Git - libvirt.git/commitdiff
iohelper: Remove remaining newlines from error messages
authorAndrea Bolognani <abologna@redhat.com>
Tue, 19 Feb 2019 15:03:54 +0000 (16:03 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Wed, 20 Feb 2019 07:51:39 +0000 (08:51 +0100)
The iohelper is an internal program that's only supposed to
be called by libvirt, and whatever output it might produce
will ultimately be passed to virReportError() or similar.

Since we do not want strings passed to those functions to
contain newlines, we can simply not output them in the first
place.

This is what happens in pretty much all cases already, but
in a couple instances newlines have managed to slip in.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
src/util/iohelper.c

index aed7ef31849f395b4ed9165c835ca84d9a133a9d..ddc338b7c7473d94e2d42b04d8067cd915e41e26 100644 (file)
@@ -181,7 +181,7 @@ usage(int status)
     if (status) {
         fprintf(stderr, _("%s: try --help for more details"), program_name);
     } else {
-        printf(_("Usage: %s FILENAME FD\n"), program_name);
+        printf(_("Usage: %s FILENAME FD"), program_name);
     }
     exit(status);
 }
@@ -198,7 +198,7 @@ main(int argc, char **argv)
     if (virGettextInitialize() < 0 ||
         virThreadInitialize() < 0 ||
         virErrorInitialize() < 0) {
-        fprintf(stderr, _("%s: initialization failed\n"), program_name);
+        fprintf(stderr, _("%s: initialization failed"), program_name);
         exit(EXIT_FAILURE);
     }