aboutsummaryrefslogtreecommitdiffstats
path: root/src/json.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/json.c')
-rw-r--r--src/json.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/json.c b/src/json.c
index b5fb3fee059..5e1439f881a 100644
--- a/src/json.c
+++ b/src/json.c
@@ -229,7 +229,7 @@ json_make_string (const char *data, ptrdiff_t size)
229 Qutf_8_unix, Qt, false, true, true); 229 Qutf_8_unix, Qt, false, true, true);
230} 230}
231 231
232/* Create a multibyte Lisp string from the null-terminated UTF-8 232/* Create a multibyte Lisp string from the NUL-terminated UTF-8
233 string beginning at DATA. If the string is not a valid UTF-8 233 string beginning at DATA. If the string is not a valid UTF-8
234 string, an unspecified string is returned. Note that all callers 234 string, an unspecified string is returned. Note that all callers
235 below either pass only value UTF-8 strings or use this function for 235 below either pass only value UTF-8 strings or use this function for
@@ -301,10 +301,10 @@ json_release_object (void *object)
301} 301}
302 302
303/* Signal an error if OBJECT is not a string, or if OBJECT contains 303/* Signal an error if OBJECT is not a string, or if OBJECT contains
304 embedded null characters. */ 304 embedded NUL characters. */
305 305
306static void 306static void
307check_string_without_embedded_nulls (Lisp_Object object) 307check_string_without_embedded_nuls (Lisp_Object object)
308{ 308{
309 CHECK_STRING (object); 309 CHECK_STRING (object);
310 CHECK_TYPE (memchr (SDATA (object), '\0', SBYTES (object)) == NULL, 310 CHECK_TYPE (memchr (SDATA (object), '\0', SBYTES (object)) == NULL,
@@ -381,8 +381,8 @@ lisp_to_json_toplevel_1 (Lisp_Object lisp,
381 { 381 {
382 Lisp_Object key = json_encode (HASH_KEY (h, i)); 382 Lisp_Object key = json_encode (HASH_KEY (h, i));
383 /* We can't specify the length, so the string must be 383 /* We can't specify the length, so the string must be
384 null-terminated. */ 384 NUL-terminated. */
385 check_string_without_embedded_nulls (key); 385 check_string_without_embedded_nuls (key);
386 const char *key_str = SSDATA (key); 386 const char *key_str = SSDATA (key);
387 /* Reject duplicate keys. These are possible if the hash 387 /* Reject duplicate keys. These are possible if the hash
388 table test is not `equal'. */ 388 table test is not `equal'. */
@@ -432,8 +432,8 @@ lisp_to_json_toplevel_1 (Lisp_Object lisp,
432 CHECK_SYMBOL (key_symbol); 432 CHECK_SYMBOL (key_symbol);
433 Lisp_Object key = SYMBOL_NAME (key_symbol); 433 Lisp_Object key = SYMBOL_NAME (key_symbol);
434 /* We can't specify the length, so the string must be 434 /* We can't specify the length, so the string must be
435 null-terminated. */ 435 NUL-terminated. */
436 check_string_without_embedded_nulls (key); 436 check_string_without_embedded_nuls (key);
437 key_str = SSDATA (key); 437 key_str = SSDATA (key);
438 /* In plists, ensure leading ":" in keys is stripped. It 438 /* In plists, ensure leading ":" in keys is stripped. It
439 will be reconstructed later in `json_to_lisp'.*/ 439 will be reconstructed later in `json_to_lisp'.*/
@@ -568,7 +568,7 @@ false values, t, numbers, strings, or other vectors hashtables, alists
568or plists. t will be converted to the JSON true value. Vectors will 568or plists. t will be converted to the JSON true value. Vectors will
569be converted to JSON arrays, whereas hashtables, alists and plists are 569be converted to JSON arrays, whereas hashtables, alists and plists are
570converted to JSON objects. Hashtable keys must be strings without 570converted to JSON objects. Hashtable keys must be strings without
571embedded null characters and must be unique within each object. Alist 571embedded NUL characters and must be unique within each object. Alist
572and plist keys must be symbols; if a key is duplicate, the first 572and plist keys must be symbols; if a key is duplicate, the first
573instance is used. 573instance is used.
574 574
@@ -945,7 +945,7 @@ usage: (json-parse-string STRING &rest ARGS) */)
945 945
946 Lisp_Object string = args[0]; 946 Lisp_Object string = args[0];
947 Lisp_Object encoded = json_encode (string); 947 Lisp_Object encoded = json_encode (string);
948 check_string_without_embedded_nulls (encoded); 948 check_string_without_embedded_nuls (encoded);
949 struct json_configuration conf = {json_object_hashtable, QCnull, QCfalse}; 949 struct json_configuration conf = {json_object_hashtable, QCnull, QCfalse};
950 json_parse_args (nargs - 1, args + 1, &conf, true); 950 json_parse_args (nargs - 1, args + 1, &conf, true);
951 951