summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-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;
}