Clean up util md5sum method
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
0ee9ced4cb
commit
deb5601d8d
1 changed files with 1 additions and 2 deletions
|
@ -701,7 +701,7 @@ char SYMEXPORT *alpm_compute_md5sum(const char *filename)
|
||||||
ASSERT(filename != NULL, return NULL);
|
ASSERT(filename != NULL, return NULL);
|
||||||
|
|
||||||
/* allocate 32 chars plus 1 for 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 */
|
/* defined above for OpenSSL, otherwise defined in md5.h */
|
||||||
ret = md5_file(filename, output);
|
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 is acceptable here because we know our output */
|
||||||
sprintf(md5sum +(i * 2), "%02x", output[i]);
|
sprintf(md5sum +(i * 2), "%02x", output[i]);
|
||||||
}
|
}
|
||||||
md5sum[32] = '\0';
|
|
||||||
|
|
||||||
return md5sum;
|
return md5sum;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue