iUse explicit sizes - dedup - deduplicating backup program Err bitreich.org 70 hgit clone git://bitreich.org/dedup/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/dedup/ URL:git://bitreich.org/dedup/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/dedup/ bitreich.org 70 1Log /scm/dedup/log.gph bitreich.org 70 1Files /scm/dedup/files.gph bitreich.org 70 1Refs /scm/dedup/refs.gph bitreich.org 70 1Tags /scm/dedup/tag bitreich.org 70 1README /scm/dedup/file/README.gph bitreich.org 70 1LICENSE /scm/dedup/file/LICENSE.gph bitreich.org 70 i--- Err bitreich.org 70 1commit 9d31ed41e0feb2f2c432ef8d8666a6a0476c8f4f /scm/dedup/commit/9d31ed41e0feb2f2c432ef8d8666a6a0476c8f4f.gph bitreich.org 70 1parent faf2fab2ac2febc631159913683d1c3dbc5166b3 /scm/dedup/commit/faf2fab2ac2febc631159913683d1c3dbc5166b3.gph bitreich.org 70 hAuthor: sin URL:mailto:sin@2f30.org bitreich.org 70 iDate: Sun, 12 May 2019 16:38:20 +0100 Err bitreich.org 70 i Err bitreich.org 70 iUse explicit sizes Err bitreich.org 70 i Err bitreich.org 70 iDiffstat: Err bitreich.org 70 i M bstorage.c | 4 ++-- Err bitreich.org 70 i M state.c | 2 +- Err bitreich.org 70 i Err bitreich.org 70 i2 files changed, 3 insertions(+), 3 deletions(-) Err bitreich.org 70 i--- Err bitreich.org 70 1diff --git a/bstorage.c b/bstorage.c /scm/dedup/file/bstorage.c.gph bitreich.org 70 i@@ -129,7 +129,7 @@ unpackbhdr(int fd, struct bhdr *bhdr) Err bitreich.org 70 i unsigned char buf[BHDRSIZE]; Err bitreich.org 70 i int n; Err bitreich.org 70 i Err bitreich.org 70 i- if (xread(fd, buf, sizeof(buf)) != sizeof(buf)) { Err bitreich.org 70 i+ if (xread(fd, buf, BHDRSIZE) != BHDRSIZE) { Err bitreich.org 70 i seterr("failed to read block header: %s", strerror(errno)); Err bitreich.org 70 i return -1; Err bitreich.org 70 i } Err bitreich.org 70 i@@ -171,7 +171,7 @@ unpackbd(int fd, struct bd *bd) Err bitreich.org 70 i char fmt[BUFSIZ]; Err bitreich.org 70 i int n; Err bitreich.org 70 i Err bitreich.org 70 i- if (xread(fd, buf, sizeof(buf)) != sizeof(buf)) { Err bitreich.org 70 i+ if (xread(fd, buf, BDSIZE) != BDSIZE) { Err bitreich.org 70 i seterr("failed to read block descriptor: %s", Err bitreich.org 70 i strerror(errno)); Err bitreich.org 70 i return -1; Err bitreich.org 70 1diff --git a/state.c b/state.c /scm/dedup/file/state.c.gph bitreich.org 70 i@@ -43,7 +43,7 @@ unpackshdr(int fd, struct shdr *shdr) Err bitreich.org 70 i unsigned char buf[SHDRSIZE]; Err bitreich.org 70 i int n; Err bitreich.org 70 i Err bitreich.org 70 i- if (xread(fd, buf, sizeof(buf)) != sizeof(buf)) { Err bitreich.org 70 i+ if (xread(fd, buf, SHDRSIZE) != SHDRSIZE) { Err bitreich.org 70 i seterr("failed to read state header: %s", strerror(errno)); Err bitreich.org 70 i return -1; Err bitreich.org 70 i } Err bitreich.org 70 .