summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-06-16 13:16:37 -0500
committerDan McGee <dan@archlinux.org>2011-06-20 00:08:15 -0500
commitdeb5601d8d19760fd569abe3508786d97cc1ceba (patch)
tree1162d465b74f41b0141401f1e84a9a61739142f3
parent0ee9ced4cbcff27823d4a1d5e0ef8a49dfc9dd8e (diff)
downloadpacman-deb5601d8d19760fd569abe3508786d97cc1ceba.tar.xz
Clean up util md5sum method
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--lib/libalpm/util.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c
index 357ce506..4976703a 100644
--- a/lib/libalpm/util.c
+++ b/lib/libalpm/util.c
@@ -701,7 +701,7 @@ char SYMEXPORT *alpm_compute_md5sum(const char *filename)
ASSERT(filename != NULL, return NULL);
/* allocate 32 chars plus 1 for null */
- md5sum = calloc(33, sizeof(char));
+ CALLOC(md5sum, 33, sizeof(char), return NULL);
/* defined above for OpenSSL, otherwise defined in md5.h */
ret = md5_file(filename, output);
@@ -714,7 +714,6 @@ char SYMEXPORT *alpm_compute_md5sum(const char *filename)
/* sprintf is acceptable here because we know our output */
sprintf(md5sum +(i * 2), "%02x", output[i]);
}
- md5sum[32] = '\0';
return md5sum;
}