aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--URPM.xs10
1 files changed, 5 insertions, 5 deletions
diff --git a/URPM.xs b/URPM.xs
index 90e896f..20dcea3 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -174,9 +174,9 @@ get_int(Header header, int32_t tag) {
return ep ? *ep : 0;
}
-static int
-sigsize_to_filesize(int sigsize) {
- return sigsize + 440; /* 440 is the rpm header size (?) empirical, but works */
+static size_t
+get_filesize(const Header h) {
+ return get_int(h, RPMTAG_SIGSIZE) + 440; /* 440 is the rpm header size (?) empirical, but works */
}
static int
@@ -801,7 +801,7 @@ pack_header(URPM__Package pkg) {
get_name(pkg->h, RPMTAG_GROUP));
pkg->info = memcpy(malloc(p-buff), buff, p-buff);
}
- if (pkg->filesize == 0) pkg->filesize = sigsize_to_filesize(get_int(pkg->h, RPMTAG_SIGSIZE));
+ if (pkg->filesize == 0) pkg->filesize = get_filesize(pkg->h);
if (pkg->requires == NULL && pkg->suggests == NULL)
has_old_suggests = 0;
pkg->requires = pack_list(pkg->h, RPMTAG_REQUIRENAME, RPMTAG_REQUIREFLAGS, RPMTAG_REQUIREVERSION, is_not_old_suggests);
@@ -1881,7 +1881,7 @@ Pkg_filesize(pkg)
if (pkg->filesize) {
RETVAL = pkg->filesize;
} else if (pkg->h) {
- RETVAL = sigsize_to_filesize(get_int(pkg->h, RPMTAG_SIGSIZE));
+ RETVAL = get_filesize(pkg->h);
} else RETVAL = 0;
OUTPUT:
RETVAL