]> git.ipfire.org Git - thirdparty/json-c.git/commitdiff
Update json_util 97/head
authorPascal Bach <pasci.bach@gmail.com>
Tue, 13 Aug 2013 16:24:23 +0000 (18:24 +0200)
committerPascal Bach <pascal.bach@siemens.com>
Tue, 13 Aug 2013 16:27:02 +0000 (18:27 +0200)
filename should be passed as const char* to functions
json_object_to_file and json_object_to_file

json_util.c
json_util.h

index cab2f1ec0fbe9ba65ff55a24335f81508b12be92..531f9afb3a03fb1499ba284a25cac75dcb7df2d7 100644 (file)
@@ -99,7 +99,7 @@ struct json_object* json_object_from_file(const char *filename)
 
 /* extended "format and write to file" function */
 
-int json_object_to_file_ext(char *filename, struct json_object *obj, int flags)
+int json_object_to_file_ext(const char *filename, struct json_object *obj, int flags)
 {
   const char *json_str;
   int fd, ret;
@@ -141,7 +141,7 @@ int json_object_to_file_ext(char *filename, struct json_object *obj, int flags)
 
 // backwards compatible "format and write to file" function
 
-int json_object_to_file(char *filename, struct json_object *obj)
+int json_object_to_file(const char *filename, struct json_object *obj)
 {
   return json_object_to_file_ext(filename, obj, JSON_C_TO_STRING_PLAIN);
 }
index b9a69c8b6ae1c8cdfa7579290c6148402ad2862c..1005e58c5b0d89b3c65cfd3e2edecf3596e4e387 100644 (file)
@@ -22,8 +22,8 @@ extern "C" {
 
 /* utility functions */
 extern struct json_object* json_object_from_file(const char *filename);
-extern int json_object_to_file(char *filename, struct json_object *obj);
-extern int json_object_to_file_ext(char *filename, struct json_object *obj, int flags);
+extern int json_object_to_file(const char *filename, struct json_object *obj);
+extern int json_object_to_file_ext(const char *filename, struct json_object *obj, int flags);
 extern int json_parse_int64(const char *buf, int64_t *retval);
 extern int json_parse_double(const char *buf, double *retval);