Use explicit sizes - dedup - deduplicating backup program
 (HTM) git clone git://bitreich.org/dedup/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/dedup/
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) Tags
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 9d31ed41e0feb2f2c432ef8d8666a6a0476c8f4f
 (DIR) parent faf2fab2ac2febc631159913683d1c3dbc5166b3
 (HTM) Author: sin <sin@2f30.org>
       Date:   Sun, 12 May 2019 16:38:20 +0100
       
       Use explicit sizes
       
       Diffstat:
         M bstorage.c                          |       4 ++--
         M state.c                             |       2 +-
       
       2 files changed, 3 insertions(+), 3 deletions(-)
       ---
 (DIR) 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;
 (DIR) 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;
                }