diff options
Diffstat (limited to 'src/json.c')
-rw-r--r-- | src/json.c | 18 |
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) Qutf_8_unix, Qt, false, true, true); } -/* Create a multibyte Lisp string from the null-terminated UTF-8 +/* Create a multibyte Lisp string from the NUL-terminated UTF-8 string beginning at DATA. If the string is not a valid UTF-8 string, an unspecified string is returned. Note that all callers below either pass only value UTF-8 strings or use this function for @@ -301,10 +301,10 @@ json_release_object (void *object) } /* Signal an error if OBJECT is not a string, or if OBJECT contains - embedded null characters. */ + embedded NUL characters. */ static void -check_string_without_embedded_nulls (Lisp_Object object) +check_string_without_embedded_nuls (Lisp_Object object) { CHECK_STRING (object); CHECK_TYPE (memchr (SDATA (object), '\0', SBYTES (object)) == NULL, @@ -381,8 +381,8 @@ lisp_to_json_toplevel_1 (Lisp_Object lisp, { Lisp_Object key = json_encode (HASH_KEY (h, i)); /* We can't specify the length, so the string must be - null-terminated. */ - check_string_without_embedded_nulls (key); + NUL-terminated. */ + check_string_without_embedded_nuls (key); const char *key_str = SSDATA (key); /* Reject duplicate keys. These are possible if the hash table test is not `equal'. */ @@ -432,8 +432,8 @@ lisp_to_json_toplevel_1 (Lisp_Object lisp, CHECK_SYMBOL (key_symbol); Lisp_Object key = SYMBOL_NAME (key_symbol); /* We can't specify the length, so the string must be - null-terminated. */ - check_string_without_embedded_nulls (key); + NUL-terminated. */ + check_string_without_embedded_nuls (key); key_str = SSDATA (key); /* In plists, ensure leading ":" in keys is stripped. It will be reconstructed later in `json_to_lisp'.*/ @@ -568,7 +568,7 @@ false values, t, numbers, strings, or other vectors hashtables, alists or plists. t will be converted to the JSON true value. Vectors will be converted to JSON arrays, whereas hashtables, alists and plists are converted to JSON objects. Hashtable keys must be strings without -embedded null characters and must be unique within each object. Alist +embedded NUL characters and must be unique within each object. Alist and plist keys must be symbols; if a key is duplicate, the first instance is used. @@ -945,7 +945,7 @@ usage: (json-parse-string STRING &rest ARGS) */) Lisp_Object string = args[0]; Lisp_Object encoded = json_encode (string); - check_string_without_embedded_nulls (encoded); + check_string_without_embedded_nuls (encoded); struct json_configuration conf = {json_object_hashtable, QCnull, QCfalse}; json_parse_args (nargs - 1, args + 1, &conf, true); |