From e960f7eb17f8d72f00364e9fc9f9a27b5563e318 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 26 Sep 2010 14:48:51 -0400 Subject: mtd-utils: standardize PROGRAM_NAME Make sure all the utils define PROGRAM_NAME and do so at the start of the file so that sub-headers may assume it exists. Signed-off-by: Mike Frysinger Signed-off-by: Artem Bityutskiy --- nandwrite.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'nandwrite.c') diff --git a/nandwrite.c b/nandwrite.c index 9eb2004..3520c62 100644 --- a/nandwrite.c +++ b/nandwrite.c @@ -19,6 +19,9 @@ * Bug/ToDo: */ +#define PROGRAM_NAME "nandwrite" +#define VERSION "$Revision: 1.32 $" + #define _GNU_SOURCE #include #include @@ -39,9 +42,6 @@ #include #include "mtd/mtd-user.h" -#define PROGRAM "nandwrite" -#define VERSION "$Revision: 1.32 $" - #define MAX_PAGE_SIZE 4096 #define MAX_OOB_SIZE 128 @@ -94,16 +94,17 @@ static void display_help (void) static void display_version (void) { - printf(PROGRAM " " VERSION "\n" + printf("%1$s " VERSION "\n" "\n" "Copyright (C) 2003 Thomas Gleixner \n" "\n" - PROGRAM " comes with NO WARRANTY\n" + "%1$s comes with NO WARRANTY\n" "to the extent permitted by law.\n" "\n" - "You may redistribute copies of " PROGRAM "\n" + "You may redistribute copies of %1$s\n" "under the terms of the GNU General Public Licence.\n" - "See the file `COPYING' for more information.\n"); + "See the file `COPYING' for more information.\n", + PROGRAM_NAME); exit (EXIT_SUCCESS); } -- cgit v1.2.3