]> git.ipfire.org Git - pakfire.git/commitdiff
json: Add string formatting attribute
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 10 Feb 2025 15:09:07 +0000 (15:09 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 10 Feb 2025 15:09:07 +0000 (15:09 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/json.h

index 764bf2a7cb1a2cec6662ff9a9abde37caeca0b00..6c1359417ab3fa50e5ca6293a8684d46dff10667 100644 (file)
@@ -48,7 +48,8 @@ int pakfire_json_add_object(struct json_object* json, const char* name, struct j
 int pakfire_json_add_array(struct json_object* json, const char* name, struct json_object** array);
 
 int pakfire_json_array_add_string(struct json_object* array, const char* s);
-int pakfire_json_array_add_stringf(struct json_object* array, const char* format, ...);
+int pakfire_json_array_add_stringf(struct json_object* array, const char* format, ...)
+       __attribute__((format(printf, 2, 3)));;
 
 int pakfire_json_get_string(struct json_object* json, const char* key, const char** value);
 int pakfire_json_get_int64(struct json_object* json, const char* key, int64_t* value);