move the the function init_tables() definitions from header file
to .c file to fix make checkheaders warning.
Signed-off-by: Jun Zhao <mypopydev@gmail.com>
Avoid undefined behavior in skip_input() by checking that enough data is
available before incrementing input pointer.
Check return values of parse_key() and skip_input() and exit early with
error if there is not enough data.