- PEPPER_CHECK is definition to check invalid values
using do-while, so continue command is not work
intentionally.
- so change to check value condition if instead
PEPPER_CHECK(do-while)
Change-Id: I2ca32e30b53e8ae2f23114233855ad3224d7895a
tmp = strtok_r(NULL, " ", &buf_ptr);
if (!tmp) continue;
keycode = atoi(tmp);
- PEPPER_CHECK(((0 < keycode) && (keycode < KEYROUTER_MAX_KEYS)),
- continue, "Currently %d key is invalid to support\n", keycode);
+ if ((0 >= keycode) || (keycode >= KEYROUTER_MAX_KEYS)) {
+ PEPPER_ERROR("Currently %d key is invalid to support\n", keycode);
+ continue;
+ }
pepper_keyrouter->opts[keycode].enabled = PEPPER_TRUE;