summaryrefslogtreecommitdiff
path: root/util/cbfstool/create.c
diff options
context:
space:
mode:
authorMyles Watson <mylesgw@gmail.com>2009-05-08 19:39:15 +0000
committerMyles Watson <mylesgw@gmail.com>2009-05-08 19:39:15 +0000
commit475aeda9d6d62d0249276bff657adc67d206ff31 (patch)
tree6b3d9371ce61197417ed308faca8cc36691ac58e /util/cbfstool/create.c
parent83b8f0c48550bb1b2cb1a6610b1f0010bf8533a4 (diff)
Add -Werror to help us keep the code clean.
Change sizes from unsigned int to int. Clean up some usage and parameter checking. Signed-off-by: Myles Watson <mylesgw@gmail.com> Acked-by: Ronald G. Minnich <rminnich@gmail.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4262 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/cbfstool/create.c')
-rw-r--r--util/cbfstool/create.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/util/cbfstool/create.c b/util/cbfstool/create.c
index ecfb21c956..e83758c992 100644
--- a/util/cbfstool/create.c
+++ b/util/cbfstool/create.c
@@ -24,7 +24,7 @@
void create_usage(void)
{
- printf("create SIZE BOOTBLOCKSIZE [ALIGN] [BOOTBLOCK]\tCreate a ROM file\n");
+ printf("create SIZE BOOTBLOCKSIZE BOOTBLOCK [ALIGN]\tCreate a ROM file\n");
}
int create_handler(struct rom *rom, int argc, char **argv)
@@ -33,7 +33,7 @@ int create_handler(struct rom *rom, int argc, char **argv)
char *bootblock = NULL;
int bootblocksize;
- if (argc < 2) {
+ if (argc < 3) {
create_usage();
return -1;
}
@@ -42,11 +42,10 @@ int create_handler(struct rom *rom, int argc, char **argv)
bootblocksize = get_size(argv[1]);
- if (argc == 3) {
- bootblock = argv[2];
- } else if (argc >= 4) {
- align = strtoul(argv[2], NULL, 0);
- bootblock = argv[3];
+ bootblock = argv[2];
+
+ if (argc >= 4) {
+ align = strtoul(argv[3], NULL, 0);
}
if (size < bootblocksize) {