mirror of
https://github.com/moparisthebest/pacman
synced 2025-01-07 11:58:02 -05:00
Fix function indentation
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
08d885fda5
commit
c41edf49be
@ -684,36 +684,36 @@ int _alpm_lstat(const char *path, struct stat *buf)
|
|||||||
#ifdef HAVE_LIBSSL
|
#ifdef HAVE_LIBSSL
|
||||||
static int md5_file(const char *path, unsigned char output[16])
|
static int md5_file(const char *path, unsigned char output[16])
|
||||||
{
|
{
|
||||||
FILE *f;
|
FILE *f;
|
||||||
size_t n;
|
size_t n;
|
||||||
MD5_CTX ctx;
|
MD5_CTX ctx;
|
||||||
unsigned char *buf;
|
unsigned char *buf;
|
||||||
|
|
||||||
CALLOC(buf, 8192, sizeof(unsigned char), return(1));
|
CALLOC(buf, 8192, sizeof(unsigned char), return(1));
|
||||||
|
|
||||||
if((f = fopen(path, "rb")) == NULL) {
|
if((f = fopen(path, "rb")) == NULL) {
|
||||||
free(buf);
|
free(buf);
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
MD5_Init(&ctx);
|
MD5_Init(&ctx);
|
||||||
|
|
||||||
while((n = fread(buf, 1, sizeof(buf), f)) > 0) {
|
while((n = fread(buf, 1, sizeof(buf), f)) > 0) {
|
||||||
MD5_Update(&ctx, buf, n);
|
MD5_Update(&ctx, buf, n);
|
||||||
}
|
}
|
||||||
|
|
||||||
MD5_Final(output, &ctx);
|
MD5_Final(output, &ctx);
|
||||||
|
|
||||||
memset(&ctx, 0, sizeof(MD5_CTX));
|
memset(&ctx, 0, sizeof(MD5_CTX));
|
||||||
free(buf);
|
free(buf);
|
||||||
|
|
||||||
if(ferror(f) != 0) {
|
if(ferror(f) != 0) {
|
||||||
fclose(f);
|
fclose(f);
|
||||||
return(2);
|
return(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose(f);
|
fclose(f);
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user