]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Explicitly truncate the value to indicate that we know truncation is
authorhno <>
Sat, 20 Apr 2002 03:03:48 +0000 (03:03 +0000)
committerhno <>
Sat, 20 Apr 2002 03:03:48 +0000 (03:03 +0000)
needed when assigning an int derived value to a char..

lib/base64.c

index 20e893bd7442cef1780da3d36ad40773a62aeaec..adee8e334af2ae73d81570b4c415dd04f0b870ef 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: base64.c,v 1.19 2001/06/29 20:20:01 wessels Exp $
+ * $Id: base64.c,v 1.20 2002/04/19 21:03:48 hno Exp $
  */
 
 #include "config.h"
@@ -58,7 +58,7 @@ base64_decode(const char *p)
        if (++c < 4)
            continue;
        /* One quantum of four encoding characters/24 bit */
-       result[j++] = val >> 16;        /* High 8 bits */
+       result[j++] = (val >> 16) & 0xff;       /* High 8 bits */
        result[j++] = (val >> 8) & 0xff;        /* Mid 8 bits */
        result[j++] = val & 0xff;       /* Low 8 bits */
        val = c = 0;