From: Michael Tremer Date: Wed, 25 Jun 2025 10:14:43 +0000 (+0000) Subject: client: Remove unused string extraction function X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d5b7c8db883c5a23212a815c6eb502c1b4d4baf4;p=pakfire.git client: Remove unused string extraction function Signed-off-by: Michael Tremer --- diff --git a/src/pakfire/client.c b/src/pakfire/client.c index 8c4039b4..3c3f4314 100644 --- a/src/pakfire/client.c +++ b/src/pakfire/client.c @@ -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) {