summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--RPM4/src/RPM4.xs6
1 files changed, 3 insertions, 3 deletions
diff --git a/RPM4/src/RPM4.xs b/RPM4/src/RPM4.xs
index 3f54b29..3f252dc 100644
--- a/RPM4/src/RPM4.xs
+++ b/RPM4/src/RPM4.xs
@@ -946,11 +946,11 @@ Header_string(h, no_header_magic = 0)
PREINIT:
char * string = NULL;
char * ptr = NULL;
- int hsize = 0;
+ unsigned int hsize = 0;
PPCODE:
- hsize = headerSizeof(h, no_header_magic ? HEADER_MAGIC_NO : HEADER_MAGIC_YES);
- string = headerUnload(h);
+ string = headerExport(h, &hsize);
if (! no_header_magic) {
+ hsize +=sizeof(header_magic); // Adjust for header_magic
ptr = malloc(hsize);
memcpy(ptr, header_magic, 8);
memcpy(ptr + 8, string, hsize - 8);