aboutsummaryrefslogtreecommitdiffstats
path: root/sum_fd.c
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2026-05-17 21:02:39 +0200
committerMattias Andrée <m@maandree.se>2026-05-17 21:02:39 +0200
commit5fb2a5fe67521a452463e6b91cee406ec14c35a0 (patch)
treef6be3a0c9086ef7122a7d5789818bdc7c0bb1081 /sum_fd.c
parentUpdate year (diff)
downloadlibsha2-1.1.5.tar.gz
libsha2-1.1.5.tar.bz2
libsha2-1.1.5.tar.xz
Fix mistakesHEAD1.1.5master
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to '')
-rw-r--r--sum_fd.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sum_fd.c b/sum_fd.c
index 1992cfd..23e4ca5 100644
--- a/sum_fd.c
+++ b/sum_fd.c
@@ -18,15 +18,15 @@ libsha2_sum_fd(int fd, enum libsha2_algorithm algorithm, void *restrict hashsum)
#ifndef _WIN32
if (fstat(fd, &attr) == 0 && attr.st_blksize > 0)
- blksize = (size_t)(attr.st_blksize);
+ blksize = (size_t)attr.st_blksize;
#endif
#if ALLOCA_LIMIT > 0
if (blksize > (size_t)ALLOCA_LIMIT) {
blksize = (size_t)ALLOCA_LIMIT;
- blksize -= blksize % sizeof(((struct libsha2_state)NULL)->chunk);
+ blksize -= blksize % sizeof(((struct libsha2_state *)NULL)->chunk);
if (!blksize)
- blksize = sizeof(((struct libsha2_state)NULL)->chunk);
+ blksize = sizeof(((struct libsha2_state *)NULL)->chunk);
}
# if defined(__clang__)
/* We are using a limit so it's just like declaring an array
@@ -60,6 +60,7 @@ libsha2_sum_fd(int fd, enum libsha2_algorithm algorithm, void *restrict hashsum)
}
libsha2_digest(&state, NULL, 0, hashsum);
+
#if ALLOCA_LIMIT <= 0
free(chunk);
#endif