There is no need to use a buffer at all.
authorgraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Tue, 24 Nov 2009 02:31:32 +0000 (02:31 +0000)
committergraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Tue, 24 Nov 2009 02:31:32 +0000 (02:31 +0000)
git-svn-id: http://opkg.googlecode.com/svn/trunk@352 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

libopkg/pkg_extract.c

index e1b4018bfa400a30488e23b679a46260af65a6b0..d9fbdd5f6d7b69479483885e307b192a2549596d 100644 (file)
@@ -29,20 +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_stdout, /* to stream actually */
                               NULL, "./control");
-    if (buffer == NULL) {
-       return EINVAL;
-    }
-
-    if (fputs(buffer, stream) == EOF) {
-       free(buffer);
-       return EINVAL;
-    }
-
-    free(buffer);
 
     return 0;
 }