diff options
author | Dan McGee <dan@archlinux.org> | 2011-04-16 02:30:11 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-04-21 03:11:26 +0200 |
commit | 442e1420f95ecc6fd1967677c1be5dfed6584542 (patch) | |
tree | 42c26edf4408acad0580c543262aee51e8e91c95 /lib/libalpm/package.c | |
parent | 3c5661ec3cd5cdf2f1c3101d90789c83786a6897 (diff) | |
download | pacman-442e1420f95ecc6fd1967677c1be5dfed6584542.tar.gz pacman-442e1420f95ecc6fd1967677c1be5dfed6584542.tar.xz |
Rename gpgsig struct fields for clarity
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/package.c')
-rw-r--r-- | lib/libalpm/package.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c index 3e787d45..8c927c11 100644 --- a/lib/libalpm/package.c +++ b/lib/libalpm/package.c @@ -198,25 +198,26 @@ const char SYMEXPORT *alpm_pkg_get_md5sum(pmpkg_t *pkg) } static int decode_pgpsig(pmpkg_t *pkg) { - int len = strlen(pkg->pgpsig.encdata); - const unsigned char *usline = (const unsigned char *)pkg->pgpsig.encdata; - int destlen = 0; + const int len = strlen(pkg->pgpsig.base64_data); + const unsigned char *usline = (const unsigned char *)pkg->pgpsig.base64_data; + int ret, destlen = 0; /* get the necessary size for the buffer by passing 0 */ - int ret = base64_decode(NULL, &destlen, usline, len); + ret = base64_decode(NULL, &destlen, usline, len); /* alloc our memory and repeat the call to decode */ - MALLOC(pkg->pgpsig.rawdata, (size_t)destlen, goto error); - ret = base64_decode(pkg->pgpsig.rawdata, &destlen, usline, len); - pkg->pgpsig.rawlen = destlen; + MALLOC(pkg->pgpsig.data, (size_t)destlen, goto error); + ret = base64_decode(pkg->pgpsig.data, &destlen, usline, len); + pkg->pgpsig.len = destlen; if(ret != 0) { goto error; } - FREE(pkg->pgpsig.encdata); + /* we no longer have a need for this */ + FREE(pkg->pgpsig.base64_data); return 0; error: - FREE(pkg->pgpsig.rawdata); - pkg->pgpsig.rawlen = 0; + FREE(pkg->pgpsig.data); + pkg->pgpsig.len = 0; return 1; } @@ -227,7 +228,7 @@ const pmpgpsig_t SYMEXPORT *alpm_pkg_get_pgpsig(pmpkg_t *pkg) /* Sanity checks */ ASSERT(pkg != NULL, RET_ERR(PM_ERR_WRONG_ARGS, NULL)); - if(pkg->pgpsig.rawdata == NULL && pkg->pgpsig.encdata != NULL) { + if(pkg->pgpsig.data == NULL && pkg->pgpsig.base64_data != NULL) { decode_pgpsig(pkg); } return &(pkg->pgpsig); @@ -467,8 +468,8 @@ void _alpm_pkg_free(pmpkg_t *pkg) FREE(pkg->url); FREE(pkg->packager); FREE(pkg->md5sum); - FREE(pkg->pgpsig.encdata); - FREE(pkg->pgpsig.rawdata); + FREE(pkg->pgpsig.base64_data); + FREE(pkg->pgpsig.data); FREE(pkg->arch); FREELIST(pkg->licenses); FREELIST(pkg->replaces); |