Commit Graph

995 Commits

Author SHA1 Message Date
Tobias Stoeckmann
38b001edbd Handle vsnprintf corner cases.
The function vsnprintf returns a negative value on error, e.g. on
an invalid format. It's best to return NULL in such a case.

Also avoid a signed integer overflow if vsnprintf returns INT_MAX.
This is undefined behaviour in C and has to be avoided.

A negative value is returned with a call like:
json_sprintf("%111111111111111s", "", "");

INT_MAX is returned with a call like:
json_sprintf("%647s%2147483000s", "", "");
2020-05-23 12:34:40 +02:00
Petri Lehtinen
e9ebfa7e77 jansson 2.13.1 2020-05-07 21:38:59 +03:00
Petri Lehtinen
3f4d948652
Merge pull request #535 from xry111/clang-format-check-dist-fix
add `scripts` directory to EXTRA_DIST
2020-05-07 21:29:30 +03:00
Petri Lehtinen
a839d3cad6
Merge pull request #534 from xry111/shared_lib_interface_fix
add jansson_* to shared library exports
2020-05-07 21:28:47 +03:00
Xℹ Ruoyao
2d2efde34a add scripts directory to EXTRA_DIST 2020-05-06 18:01:19 +08:00
Xℹ Ruoyao
bcb6b6f3fd add jansson_* to shared library exports 2020-05-06 17:31:48 +08:00
Petri Lehtinen
2882ead5bb jansson 2.13 2020-05-05 07:07:16 +03:00
Petri Lehtinen
4c9018cc4c
Merge pull request #521 from NanXiao/patch-1
Update apiref.rst
2020-01-21 10:15:01 +02:00
Nan Xiao
e15fd861e1
Update apiref.rst 2020-01-21 14:27:52 +08:00
Petri Lehtinen
ca88677bdd
Merge pull request #510 from AllenX2018/improve-build-doc
add MinGW build guideline and tips to disable building docs
2019-10-24 11:23:00 +03:00
Petri Lehtinen
6e211b24fe
Fix the length of a section heading 2019-10-24 11:22:46 +03:00
Petri Lehtinen
50c9623e37
Merge pull request #509 from AllenX2018/update-CHANGES
add changes since v2.12
2019-10-24 11:19:52 +03:00
Petri Lehtinen
3704e1cd78
Small modifications to CHANGES 2019-10-24 11:19:34 +03:00
allen
67900c85d3 add changes since v2.12 2019-10-22 18:52:55 +08:00
Petri Lehtinen
d288cc157e
Merge pull request #508 from akheron/clang-format
Format code with clang-format
2019-10-21 11:07:53 +03:00
AllenX2018
5b8ff675b3 add MinGW build guideline, add new version of Visual Studio 2019-10-21 15:53:33 +08:00
Petri Lehtinen
78da35682a Set autoconf bug-report param to point to github issues 2019-10-21 08:56:03 +03:00
Petri Lehtinen
bb4f99e919 Fix clang-format version checking 2019-10-21 08:56:03 +03:00
Petri Lehtinen
f912430cda Run clang-format with make check 2019-10-21 08:56:03 +03:00
Petri Lehtinen
a8f5fa5f5a Tweak clang-format configuration a bit
Set ColumnLimit to 90, remove AllowShortCaseLabelsOnASingleLine.
2019-10-21 08:56:03 +03:00
Petri Lehtinen
7c0297abe8 Support running a specific clang-format version in CI 2019-10-21 08:55:01 +03:00
Petri Lehtinen
1a95a60f80 Run clang-format in CI, fail the build if everything's not formatted 2019-10-21 08:55:01 +03:00
Petri Lehtinen
be0fca914e Add scripts for running clang-format 2019-10-21 08:55:01 +03:00
Petri Lehtinen
79fe8c3435 Run clang-format on *.c, *.h 2019-10-21 08:55:01 +03:00
Petri Lehtinen
7dc463ee4e Add clang-format configuration 2019-10-21 08:53:03 +03:00
Petri Lehtinen
79075d5393
Merge pull request #498 from AllenX2018/fix-issue441
fix issue #441: remove strtod definition in strconv.c
2019-10-21 08:51:36 +03:00
willson-chen
c3958a326c remove undef __NO_ISOCEXT for strtod compatiblity 2019-10-21 11:13:39 +08:00
Petri Lehtinen
f75dc840e4
Merge pull request #499 from AllenX2018/fix-issue281
Add json_object_update_new, json_object_update_existing_new and json_object_update_missing_new
2019-10-18 16:18:28 +03:00
Petri Lehtinen
25e706cce7
Merge branch 'master' into fix-issue281 2019-10-17 13:37:33 +03:00
Petri Lehtinen
8b022dad76
Merge pull request #505 from AllenX2018/recursive_object_update
Recursive object update
2019-10-17 08:36:28 +03:00
Petri Lehtinen
0eec0327be
Merge pull request #500 from AllenX2018/fix-issue426
fix issue #426: fix pipe function in MinGW
2019-10-17 08:12:42 +03:00
Petri Lehtinen
e7bed4c109
Merge pull request #501 from AllenX2018/fix-issue481
fix issue #481
2019-10-17 08:11:19 +03:00
Petri Lehtinen
355aa42b48
Merge pull request #502 from AllenX2018/fix-issue453
fix issue #453:update FindSphinx.cmake to better align with find sphinx package.
2019-10-17 08:09:20 +03:00
Petri Lehtinen
92873e9d27
Merge pull request #503 from AllenX2018/loadfd-doc
add note for non-blocking file descriptor used for json_loadfd
2019-10-17 08:07:02 +03:00
Petri Lehtinen
9e1c37c889
Merge pull request #506 from AllenX2018/add-json_equal-test-case
fix typo & add negative test case for test_equal_complex
2019-10-17 07:33:36 +03:00
allen
010092c7bd fix typo & add negative test case for test_equal_complex 2019-10-15 17:41:57 +08:00
allen
fb602f331b update the test case of json_object_update_recursive 2019-10-14 17:32:24 +08:00
allen
00d2d274bc add loop check for json_object_update_recursive function 2019-10-12 15:36:05 +08:00
allen
b403bbba8d modify some words 2019-10-12 10:56:23 +08:00
Henrique Cabral
cb4727c4a9 Add json_object_update_recursive()
Support merging values nested within objects. For instance, merging:

    {
	"foo": 1,
	"bar": {
	    "baz": 2
	}
    }

with

    {
	"bar": {
	    "baz": 3
	}
    }

results in

    {
	"foo": 1,
	"bar": {
	    "baz": 3
	}
    }

instead of overwriting the value for the bar key.
2019-10-11 11:20:25 +08:00
allen
a585a2778e add note for non-blocking file descriptor used for json_loadfd 2019-10-10 19:43:17 +08:00
AllenX2018
4f26548e3a fix issue #453 2019-10-10 16:16:10 +08:00
allen
1f889c4b60 fix issue #481 2019-10-09 17:12:04 +08:00
allen
8682f2aab3 fix issue #281 2019-10-08 20:32:27 +08:00
AllenX2018
4f3305c506 fix issue #441
It already has "strtod" function in stdlib.h and because __USE_MINGW_ANSI_STDIO is desperated
2019-10-08 19:16:50 +08:00
AllenX2018
78ea35c8e9 fix issue #426 2019-10-08 16:19:40 +08:00
Petri Lehtinen
c436bec682
Merge pull request #496 from grdowns/vcpkg-instructions
Add vcpkg installation instructions
2019-09-27 15:08:00 +03:00
grdowns
f5c0afecdb Add vcpkg installation instructions 2019-09-26 16:54:02 -07:00
Petri Lehtinen
5371816480
Merge pull request #494 from luzpaz/typos
Fix various typos
2019-09-23 11:31:23 +03:00
Petri Lehtinen
09e455275c
Merge pull request #490 from AllenX2018/master
add loop check in json deep copy #457
2019-09-23 11:30:33 +03:00