Skip to content

Commit

Permalink
fix regression
Browse files Browse the repository at this point in the history
  • Loading branch information
howard0su committed Feb 19, 2019
1 parent 1cf9272 commit 43a6a99
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/config/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down

0 comments on commit 43a6a99

Please sign in to comment.