Commit Graph

13 Commits

Author SHA1 Message Date
Eric Haszlakiewicz
8c7849e6e3 Eliminate use of ctype.h and replace isdigit() and tolower() with non-locale-sensitive approaches. 2020-08-02 04:06:44 +00:00
dota17
8b162c4b89 clang-format the files 2020-04-03 11:39:30 +08:00
dota17
c117d8a8a8 add the disabling formatting coments and adjust the partial code manuly 2020-04-03 11:28:04 +08:00
janczer
8bd62177e7 Fixed typos 2018-04-24 16:00:38 +02:00
Eric Haszlakiewicz
f8c632f579 Issue #407: fix incorrect casts in calls to ctype functions (isdigit and isspace) so we don't crash when asserts are enabled on certain platforms and characters > 128 are parsed. 2018-03-25 18:25:58 -04:00
Alexandru Ardelean
fb72160caf build: make strerror() override-able
If we want to override `strerror()` in libjson-c
to make tests consistent across platforms, we
need to do it build-wide as configure/build
option.

Apple linkers make it really hard to override functions
at link-time, and this seems to be locked down on travis-ci.org
[ for security reasons I assume ].
While I got it to work locally, it did not work
when running on travis.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-07-13 10:27:24 +03:00
Eric Haszlakiewicz
91977159ee Add cast to int in calls to isdigit() since some platforms complain about char being used as an array index. 2017-02-05 04:34:05 +00:00
Eric Haszlakiewicz
0a010a59eb Change a memcpy that should be a memmove within json_pointer_get, and fix memory leaks in of one the json_pointer tests. 2016-12-18 14:33:41 -05:00
Alexandru Ardelean
47f32a76ef vasprintf_compat.h: spin-off this compat header ; use math_compat.h as template
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2016-11-22 16:37:30 +02:00
Alexandru Ardelean
8cb86a583a strdup_compat.h: re-spin this compat header ; use math_compat.h as template
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2016-11-22 16:37:29 +02:00
Alexandru Ardelean
742e059da1 json_pointer: add json_pointer_getf/setf() function variants
These include support for printf() style args for path.

Adds support for calling with 'json_pointer_getf(obj, &res, "/foo/%d/%s", 0, bar)'
style args.

Makes it easier for doing more dynamic stuff/magic, without
needing to use vasprintf() externally.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2016-11-22 16:33:49 +02:00
Alexandru Ardelean
97dd7d5103 json_pointer.c: fix whitespace
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2016-11-16 16:15:53 +02:00
Alexandru Ardelean
0e91183300 json_pointer: add first revision
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2016-11-04 09:51:36 +02:00