summaryrefslogtreecommitdiff
path: root/rfdformat.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-09-26 14:48:51 -0400
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2010-09-27 09:31:10 +0300
commite960f7eb17f8d72f00364e9fc9f9a27b5563e318 (patch)
tree9c64699e742b6d220539a8827e29a662d9629fb7 /rfdformat.c
parent6edaa0c971aab663cda573ded5013b3b998ee5d4 (diff)
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 <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'rfdformat.c')
-rw-r--r--rfdformat.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/rfdformat.c b/rfdformat.c
index d2637a1..17d9d2d 100644
--- a/rfdformat.c
+++ b/rfdformat.c
@@ -12,6 +12,9 @@
* the beginning of each block.
*/
+#define PROGRAM_NAME "rfdformat"
+#define VERSION "$Revision 1.0 $"
+
#define _XOPEN_SOURCE 500 /* For pread/pwrite */
#include <stdio.h>
@@ -26,25 +29,24 @@
#include <mtd/mtd-user.h>
#include <linux/types.h>
-#define PROGRAM "rfdformat"
-#define VERSION "$Revision 1.0 $"
-
void display_help(void)
{
- printf("Usage: " PROGRAM " [OPTIONS] MTD-device\n"
+ printf("Usage: %s [OPTIONS] MTD-device\n"
"Formats NOR flash for resident flash disk\n"
"\n"
"-h --help display this help and exit\n"
- "-V --version output version information and exit\n");
+ "-V --version output version information and exit\n",
+ PROGRAM_NAME);
exit(0);
}
void display_version(void)
{
- printf(PROGRAM " " VERSION "\n"
+ printf("%s " VERSION "\n"
"\n"
"This is free software; see the source for copying conditions. There is NO\n"
- "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n");
+ "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n",
+ PROGRAM_NAME);
exit(0);
}