]> git.ipfire.org Git - thirdparty/json-c.git/commitdiff
pointer types discards qualifiers 519/head
authorchenguoping <chenguopingdota@163.com>
Fri, 27 Dec 2019 07:39:31 +0000 (15:39 +0800)
committerchenguoping <chenguopingdota@163.com>
Fri, 27 Dec 2019 07:39:31 +0000 (15:39 +0800)
tests/test_double_serializer.c

index 773527afbc2037271b6aad1a2ef5aa14d68760b5..bad7ef559ea53c02c6ef93d3bce18655519e4479 100644 (file)
@@ -34,7 +34,8 @@ int main()
        json_object_put(obj);
        printf("Test no zero reset serializer:\n");
        obj = json_object_new_double(3.1415000);
-       json_object_set_serializer(obj, json_object_double_to_json_string, "%.17g", NULL);
+       char data[] = "%.17g";
+       json_object_set_serializer(obj, json_object_double_to_json_string, data, NULL);
        printf("obj.to_string(reset)=%s\n", json_object_to_json_string_ext(obj, 4));
 
        json_object_put(obj);