ttohex(): use unsigned values - libeech - bittorrent library
 (HTM) git clone git://z3bra.org/libeech.git
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit b033a8902e08c34d57038b8358ea736e77138582
 (DIR) parent b30bde52988a54111ddb043a062bf5332d44e9b0
 (HTM) Author: z3bra <contactatz3bradotorg>
       Date:   Thu, 19 Oct 2017 14:44:17 +0200
       
       ttohex(): use unsigned values
       
       Diffstat:
         M util.c                              |       4 ++--
       
       1 file changed, 2 insertions(+), 2 deletions(-)
       ---
 (DIR) diff --git a/util.c b/util.c
       t@@ -9,8 +9,8 @@ tohex(char *in, char *out, size_t len)
        
                memset(out, 0, len*2 + 1);
                for (i=0, j=0; i<len; i++, j++) {
       -                out[j]   = hex[in[i] >> 4];
       -                out[++j] = hex[in[i] & 15];
       +                out[j]   = hex[(unsigned char)in[i] >> 4];
       +                out[++j] = hex[(unsigned char)in[i] & 15];
                }
        
                return out;