From 912ec5210ee5d1764ea3e2931fb52a79fdc85639 Mon Sep 17 00:00:00 2001 From: Pali Rohár Date: Tue, 20 Nov 2012 21:35:19 +0100 Subject: local: Fix condition in local_dump_image --- src/local.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/local.c b/src/local.c index c6ffc0a..aaf74ce 100644 --- a/src/local.c +++ b/src/local.c @@ -165,7 +165,7 @@ int local_dump_image(enum image_type image, const char * file) { if ( device == DEVICE_RX_51 ) { - if ( image < sizeof(nanddump_n900)/sizeof(nanddump_n900[0]) || ! nanddump_n900[image].valid ) { + if ( image >= sizeof(nanddump_n900)/sizeof(nanddump_n900[0]) || ! nanddump_n900[image].valid ) { ERROR("Unsuported image type: %s", image_type_to_string(image)); return -1; } @@ -174,7 +174,7 @@ int local_dump_image(enum image_type image, const char * file) { } else { - if ( image < sizeof(nanddump)/sizeof(nanddump[0]) || ! nanddump[image].valid ) { + if ( image >= sizeof(nanddump)/sizeof(nanddump[0]) || ! nanddump[image].valid ) { ERROR("Unsuported image type: %s", image_type_to_string(image)); return -1; } -- cgit v1.2.3