[Parted-commits] GNU Parted Official Repository: Changes to 'master'

Jim Meyering meyering at alioth.debian.org
Sat Apr 21 17:02:09 UTC 2007


 parted/parted.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 3b93925f767ee1727898674a6e357b7572157dd8
Author: Jim Meyering <jim at meyering.net>
Date:   Sat Apr 21 18:59:43 2007 +0200

    [PATCH] Avoid warning from -Wformat-security; tweak error diagnostic.
    
    * parted/parted.c (_parse_options): Upon failure, output diagnostic
    to stderr, not stdout.  Use "program_name" value, not literal "parted".
    
    Signed-off-by: Jim Meyering <jim at meyering.net>

diff --git a/parted/parted.c b/parted/parted.c
index c4adde0..ff72dcd 100644
--- a/parted/parted.c
+++ b/parted/parted.c
@@ -97,9 +97,6 @@ int     opt_machine_mode = 0;
 int     disk_is_modified = 0;
 int     is_toggle_mode = 0;
 
-static char* short_usage_msg =  N_(
-"Usage: parted [-hlmsv] [DEVICE [COMMAND [PARAMETERS]]...]\n");
-
 static char* number_msg = N_(
 "NUMBER is the partition number used by Linux.  On MS-DOS disk labels, the "
 "primary partitions number from 1 to 4, logical partitions from 5 onwards.\n");
@@ -2317,7 +2314,9 @@ while (1)
 }
 
 if (wrong == 1) {
-        printf (_(short_usage_msg));
+        fprintf (stderr,
+                 _("Usage: %s [-hlmsv] [DEVICE [COMMAND [PARAMETERS]]...]\n"),
+                 program_name);
         return 0;
 }
 



More information about the Parted-commits mailing list