diff mbox

[7/8] nandwrite: add check for negative blockalign

Message ID 1291017722-23985-7-git-send-email-computersforpeace@gmail.com
State New, archived
Headers show

Commit Message

Brian Norris Nov. 29, 2010, 8:02 a.m. UTC
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
---
 nandwrite.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

Comments

Mike Frysinger Nov. 29, 2010, 8:05 a.m. UTC | #1
On Mon, Nov 29, 2010 at 03:02, Brian Norris wrote:
> +               errmsg_die("Can't specify a negative blockalign '%d'",
> +                               blockalign);

personally, i'd avoid quotes on non-string types.  maybe also mention
the command line option that is "blockalign" ?

otherwise, these changes all look fine to me
-mike
Brian Norris Dec. 1, 2010, 6:11 a.m. UTC | #2
On 11/29/2010 12:05 AM, Mike Frysinger wrote:
> On Mon, Nov 29, 2010 at 03:02, Brian Norris wrote:
>> +               errmsg_die("Can't specify a negative blockalign '%d'",
>> +                               blockalign);
> 
> personally, i'd avoid quotes on non-string types.  maybe also mention
> the command line option that is "blockalign" ?

I'm sending some "v2" patches related to these err messages. I'm not
sure what the best, descriptive messages are, but I tried.

Brian
diff mbox

Patch

diff --git a/nandwrite.c b/nandwrite.c
index 5373a89..c409878 100644
--- a/nandwrite.c
+++ b/nandwrite.c
@@ -218,6 +218,10 @@  static void process_options(int argc, char * const argv[])
 		exit(EXIT_FAILURE);
 	}
 
+	if (blockalign < 0)
+		errmsg_die("Can't specify a negative blockalign '%d'",
+				blockalign);
+
 	argc -= optind;
 	argv += optind;