Name it after what it does: s/extract_to_stdout/extract_to_stream/
[oweals/opkg-lede.git] / libopkg / pkg_extract.c
index 4257d59806e433014c2be529a995556ae03c33d9..d8b06a6c7827f335bd35f41724086cc5fc57f774 100644 (file)
@@ -29,16 +29,10 @@ const char *applet_name = "opkg";
 
 int pkg_extract_control_file_to_stream(pkg_t *pkg, FILE *stream)
 {
-    char *buffer = deb_extract(pkg->local_filename, stderr,
+    deb_extract(pkg->local_filename, stream,
                               extract_control_tar_gz
-                              | extract_one_to_buffer,
+                              | extract_to_stream,
                               NULL, "./control");
-    if (buffer == NULL) {
-       return EINVAL;
-    }
-
-    fputs(buffer, stream);
-    free(buffer);
 
     return 0;
 }