diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/json.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/json.c b/src/json.c index 689f6ac510e..c1daba199c3 100644 --- a/src/json.c +++ b/src/json.c | |||
| @@ -352,7 +352,12 @@ lisp_to_json_toplevel_1 (Lisp_Object lisp, json_t **json) | |||
| 352 | /* We can't specify the length, so the string must be | 352 | /* We can't specify the length, so the string must be |
| 353 | null-terminated. */ | 353 | null-terminated. */ |
| 354 | check_string_without_embedded_nulls (key); | 354 | check_string_without_embedded_nulls (key); |
| 355 | int status = json_object_set_new (*json, SSDATA (key), | 355 | const char *key_str = SSDATA (key); |
| 356 | /* Reject duplicate keys. These are possible if the hash | ||
| 357 | table test is not `equal'. */ | ||
| 358 | if (json_object_get (*json, key_str) != NULL) | ||
| 359 | wrong_type_argument (Qjson_value_p, lisp); | ||
| 360 | int status = json_object_set_new (*json, key_str, | ||
| 356 | lisp_to_json (HASH_VALUE (h, i))); | 361 | lisp_to_json (HASH_VALUE (h, i))); |
| 357 | if (status == -1) | 362 | if (status == -1) |
| 358 | /* FIXME: A failure here might also indicate that the | 363 | /* FIXME: A failure here might also indicate that the |