From deb5601d8d19760fd569abe3508786d97cc1ceba Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 16 Jun 2011 13:16:37 -0500 Subject: Clean up util md5sum method Signed-off-by: Dan McGee --- lib/libalpm/util.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/libalpm') 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; } -- cgit v1.2.3-70-g09d2