]> git.ipfire.org Git - thirdparty/json-c.git/commit
json_pointer: convert index to size_t type
authorAlexandru Ardelean <ardeleanalex@gmail.com>
Sat, 24 Apr 2021 14:06:17 +0000 (17:06 +0300)
committerEric Hawicz <erh+git@nimenees.com>
Tue, 1 Aug 2023 02:17:30 +0000 (22:17 -0400)
commit43d311893516aa56ef2935cb335e169d2671669c
tree9eb7059fffb0b1f539fe6c99c2413de572ca8ec1
parentd5c5b2caec671dd2235dddac5b9c790e36cb0671
json_pointer: convert index to size_t type

The index cannot be negative when parsing in is_valid_index(), because we
don't allow the '-' character in a string before we get to the strtol()
function.

So, might as well remove the negative check (for idx) in is_valid_index()
and convert it to size_t. That may allow for higher values for the index
(which can be insane, but some people may want to try it).

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
json_pointer.c