diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-02-08 00:11:48 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-02-08 00:11:52 +0100 |
commit | 801b48edcf34f571b7ad7f99269ae683a1497a02 (patch) | |
tree | fac59bc68acc4b8f89facb33feb4cf60c8f1f261 /src/json | |
parent | 73d6858937ba98d32d83bc2f87bbbd456c9bd455 (diff) | |
download | gnunet-801b48edcf34f571b7ad7f99269ae683a1497a02.tar.gz gnunet-801b48edcf34f571b7ad7f99269ae683a1497a02.zip |
-allow packing with NULL field name
Diffstat (limited to 'src/json')
-rw-r--r-- | src/json/json_pack.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/json/json_pack.c b/src/json/json_pack.c index 296f56104..cc1ca3e97 100644 --- a/src/json/json_pack.c +++ b/src/json/json_pack.c | |||
@@ -31,6 +31,12 @@ GNUNET_JSON_pack_ (struct GNUNET_JSON_PackSpec spec[]) | |||
31 | { | 31 | { |
32 | json_t *ret; | 32 | json_t *ret; |
33 | 33 | ||
34 | if (NULL == spec[0].field_name) | ||
35 | { | ||
36 | ret = spec[0].object; | ||
37 | spec[0].object = NULL; | ||
38 | return ret; | ||
39 | } | ||
34 | ret = json_object (); | 40 | ret = json_object (); |
35 | GNUNET_assert (NULL != ret); | 41 | GNUNET_assert (NULL != ret); |
36 | for (unsigned int i = 0; | 42 | for (unsigned int i = 0; |