commit 9d31ed41e0feb2f2c432ef8d8666a6a0476c8f4f
parent faf2fab2ac2febc631159913683d1c3dbc5166b3
Author: sin <sin@2f30.org>
Date: Sun, 12 May 2019 16:38:20 +0100
Use explicit sizes
Diffstat:
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/bstorage.c b/bstorage.c
@@ -129,7 +129,7 @@ unpackbhdr(int fd, struct bhdr *bhdr)
unsigned char buf[BHDRSIZE];
int n;
- if (xread(fd, buf, sizeof(buf)) != sizeof(buf)) {
+ if (xread(fd, buf, BHDRSIZE) != BHDRSIZE) {
seterr("failed to read block header: %s", strerror(errno));
return -1;
}
@@ -171,7 +171,7 @@ unpackbd(int fd, struct bd *bd)
char fmt[BUFSIZ];
int n;
- if (xread(fd, buf, sizeof(buf)) != sizeof(buf)) {
+ if (xread(fd, buf, BDSIZE) != BDSIZE) {
seterr("failed to read block descriptor: %s",
strerror(errno));
return -1;
diff --git a/state.c b/state.c
@@ -43,7 +43,7 @@ unpackshdr(int fd, struct shdr *shdr)
unsigned char buf[SHDRSIZE];
int n;
- if (xread(fd, buf, sizeof(buf)) != sizeof(buf)) {
+ if (xread(fd, buf, SHDRSIZE) != SHDRSIZE) {
seterr("failed to read state header: %s", strerror(errno));
return -1;
}