From 43a6a99fe88f8facf68f1097a81343d9893d175d Mon Sep 17 00:00:00 2001 From: Howard Su Date: Wed, 13 Feb 2019 23:12:38 +0800 Subject: [PATCH] fix regression --- src/config/config.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/config/config.c b/src/config/config.c index 1d40f0d713..98a4810d61 100644 --- a/src/config/config.c +++ b/src/config/config.c @@ -162,9 +162,9 @@ int assign_int(void* ptr, const struct struct_map *map, int map_size, const char j = 0; } - for (; j < map[i].offset; j++) + for (; j < (map[i].offset & 0xFF); j++) { - if (mapstrcasecmp(value, callback(i)) == 0) { + if (mapstrcasecmp(value, callback(j)) == 0) { *((u8 *)((u8*)ptr + offset)) = j; return 1; } @@ -183,9 +183,9 @@ int assign_int(void* ptr, const struct struct_map *map, int map_size, const char } else { j = 0; } - for (; j < map[i].offset; j++) + for (; j < (map[i].offset & 0xFF); j++) { - if (mapstrcasecmp(value, callback(strbuf, i)) == 0) { + if (mapstrcasecmp(value, callback(strbuf, j)) == 0) { *((u8 *)((u8*)ptr + offset)) = j; return 1; }