tMake default bitfield size more accurate - libeech - bittorrent library
 (HTM) git clone git://z3bra.org/libeech.git
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 01ff08c8da3239cd769ae07f45977aa828f5cc31
 (DIR) parent 49ad884d0032f329b4d6006b1541dc3ff737148f
 (HTM) Author: z3bra <contactatz3bradotorg>
       Date:   Mon,  9 Jul 2018 08:30:42 +0200
       
       Make default bitfield size more accurate
       
       Diffstat:
         M libeech.h                           |       7 ++++---
       
       1 file changed, 4 insertions(+), 3 deletions(-)
       ---
 (DIR) diff --git a/libeech.h b/libeech.h
       t@@ -24,8 +24,8 @@ struct piece {
                int n;
                ssize_t sz;
                char blks[PCESIZ];
       -        char bf[PCENUM / 8];
       -        char rq[PCENUM / 8];
       +        char bf[PCENUM / 8 + !!(PCENUM % 8)];
       +        char rq[PCENUM / 8 + !!(PCENUM % 8)];
        };
        
        struct peer {
       t@@ -35,7 +35,8 @@ struct peer {
                char host[HOST_NAME_MAX];
                char rxbuf[MSGSIZ];
                long rxbufsz;
       -        char bf[PCENUM / 8];
       +        char bf[PCENUM / 8 + !!(PCENUM % 8)];
       +        char view[PCENUM / 8 + !!(PCENUM % 8)];
                struct piece piece;
                struct peer *next;
        };