From: oharboe Date: Sun, 24 Aug 2008 18:09:37 +0000 (+0000) Subject: Daniel Gimpelevich fix end of address space... X-Git-Tag: v0.1.0~338 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6abf942baba746df2c7195abe01a9b05cec13b1e;p=openocd Daniel Gimpelevich fix end of address space flash sector comparision git-svn-id: svn://svn.berlios.de/openocd/trunk@961 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- diff --git a/src/flash/flash.c b/src/flash/flash.c index e5adcc86..b9c9f5cf 100644 --- a/src/flash/flash.c +++ b/src/flash/flash.c @@ -905,7 +905,7 @@ flash_bank_t *get_flash_bank_by_addr(target_t *target, u32 addr) return NULL; } /* check whether address belongs to this flash bank */ - if ((addr >= c->base) && (addr < c->base + c->size) && target == c->target) + if ((addr >= c->base) && (addr <= c->base + (c->size - 1)) && target == c->target) return c; } LOG_ERROR("No flash at address 0x%08x\n", addr);