]> git.ipfire.org Git - pakfire.git/commitdiff
client: Remove unused string extraction function
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 25 Jun 2025 10:14:43 +0000 (10:14 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 25 Jun 2025 10:14:43 +0000 (10:14 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/client.c

index 8c4039b492de939cdecb6759b2ab346e19fb4fbd..3c3f4314f7c6d10a1291f137a68f22c1a6bba83b 100644 (file)
@@ -595,48 +595,6 @@ ERROR:
        return r;
 }
 
-static int pakfire_client_api_response_string(struct pakfire_client* self,
-               struct json_object* response, const char* key, char** value) {
-       struct json_object* object = NULL;
-       const char* s = NULL;
-       char* buffer = NULL;
-       int r;
-
-       // Fetch the object at key
-       r = json_object_object_get_ex(response, key, &object);
-       if (r == 0) {
-               ERROR(self->ctx, "Could not fetch '%s' from response\n", key);
-               r = -EBADMSG;
-               goto ERROR;
-       }
-
-       // Read the string
-       s = json_object_get_string(object);
-       if (!s) {
-               ERROR(self->ctx, "Could not fetch value from '%s'\n", key);
-               r = -EBADMSG;
-               goto ERROR;
-       }
-
-       // Copy the value
-       buffer = strdup(s);
-       if (!buffer) {
-               ERROR(self->ctx, "Could not copy the string: %m\n");
-               r = -errno;
-               goto ERROR;
-       }
-
-       // Return the value
-       *value = buffer;
-       return 0;
-
-ERROR:
-       if (buffer)
-               free(buffer);
-
-       return r;
-}
-
 // Uploads
 
 static void pakfire_client_upload_free(struct pakfire_client_upload* upload) {