Take advantage of new header string getters
authorPanu Matilainen <pmatilai@redhat.com>
Wed, 2 Sep 2009 10:06:25 +0000 (13:06 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Wed, 2 Sep 2009 10:06:25 +0000 (13:06 +0300)
rpm2cpio.c

index 92de0fa..6c29cab 100644 (file)
@@ -70,13 +70,8 @@ int main(int argc, char *argv[])
     }
 
     /* Retrieve type of payload compression. */
-    {  const char *compr = NULL;
-       struct rpmtd_s pc;
-
-       headerGet(h, RPMTAG_PAYLOADCOMPRESSOR, &pc, HEADERGET_DEFAULT);
-       compr = rpmtdGetString(&pc);
+    {  const char *compr = headerGetString(h, RPMTAG_PAYLOADCOMPRESSOR);
        rpmio_flags = rstrscat(NULL, "r.", compr ? compr : "gzip", NULL);
-       rpmtdFreeData(&pc);
     }
 
     gzdi = Fdopen(fdi, rpmio_flags);   /* XXX gzdi == fdi */