From fa79aec3421b5ae27dd2eedc5b959cdc3bbd3689 Mon Sep 17 00:00:00 2001 From: Fredrik Thulin Date: Wed, 29 Jun 2016 21:44:45 +0200 Subject: keystore_erase_sectors: bugfix --- stm-keystore.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stm-keystore.c b/stm-keystore.c index 63bf4be..43e22fa 100644 --- a/stm-keystore.c +++ b/stm-keystore.c @@ -59,8 +59,8 @@ int keystore_erase_sectors(uint32_t start, uint32_t stop) { uint32_t sector; - if (start > N25Q128_NUM_SECTORS || start < 0) return -2; - if (stop > N25Q128_NUM_SECTORS || stop < 0 || stop > start) return -3; + if (start > N25Q128_NUM_SECTORS) return -2; + if (stop > N25Q128_NUM_SECTORS || stop < start) return -3; for (sector = start; sector <= stop; sector++) { int timeout = 200; /* times 10ms = 2 seconds timeout */ -- cgit v1.2.3