summaryrefslogtreecommitdiff
path: root/rpm2cpio.c
diff options
context:
space:
mode:
authorJindrich Novy <jnovy@redhat.com>2008-04-09 13:05:45 +0200
committerJindrich Novy <jnovy@redhat.com>2008-04-09 16:03:17 +0200
commit61b008b5662652ac8ea05ea76611b73efe9cf656 (patch)
tree10d2c3cb25b37b0824c8238ad97297a589fe9e42 /rpm2cpio.c
parent0b0dcd114028e1e2a00870917cf07a27858a30b1 (diff)
downloadrpm-61b008b5662652ac8ea05ea76611b73efe9cf656.tar.gz
rpm-61b008b5662652ac8ea05ea76611b73efe9cf656.tar.bz2
rpm-61b008b5662652ac8ea05ea76611b73efe9cf656.zip
Don't use stack allocations in rpm2cpio when not needed
Diffstat (limited to 'rpm2cpio.c')
-rw-r--r--rpm2cpio.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/rpm2cpio.c b/rpm2cpio.c
index b18133d27..05ff8e9d3 100644
--- a/rpm2cpio.c
+++ b/rpm2cpio.c
@@ -66,17 +66,14 @@ int main(int argc, char *argv[])
/* Retrieve type of payload compression. */
{ const char * payload_compressor = NULL;
- char * t;
if (!headerGetEntry(h, RPMTAG_PAYLOADCOMPRESSOR, NULL,
(rpm_data_t *) &payload_compressor, NULL))
payload_compressor = "gzip";
- rpmio_flags = t = alloca(sizeof("r.gzdio"));
- *t++ = 'r';
if (!strcmp(payload_compressor, "gzip"))
- t = stpcpy(t, ".gzdio");
+ rpmio_flags = "r.gzdio";
if (!strcmp(payload_compressor, "bzip2"))
- t = stpcpy(t, ".bzdio");
+ rpmio_flags = "r.bzdio";
}
gzdi = Fdopen(fdi, rpmio_flags); /* XXX gzdi == fdi */