Clean up util md5sum method

Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Dan McGee 2011-06-16 13:16:37 -05:00
parent 0ee9ced4cb
commit deb5601d8d
1 changed files with 1 additions and 2 deletions

View File

@ -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;
}