diff --git a/lib/dec/head.c b/lib/dec/head.c index 08cbb37a..f19b7958 100644 --- a/lib/dec/head.c +++ b/lib/dec/head.c @@ -1,6 +1,6 @@ int ret = 0; -const char *c = src; -char *o = out; +const unsigned char *c = (const unsigned char *)src; +unsigned char *o = (unsigned char *)out; unsigned char q; /* Use local temporaries to avoid cache thrashing: */ diff --git a/lib/dec/tail.c b/lib/dec/tail.c index efdfd482..f59fa7d9 100644 --- a/lib/dec/tail.c +++ b/lib/dec/tail.c @@ -2,7 +2,7 @@ ret = 1; break; } - if ((q = base64_table_dec[(unsigned char)*c++]) >= 254) { + if ((q = base64_table_dec[*c++]) >= 254) { st.eof = 1; /* Treat character '=' as invalid for byte 0: */ break; @@ -14,7 +14,7 @@ ret = 1; break; } - if ((q = base64_table_dec[(unsigned char)*c++]) >= 254) { + if ((q = base64_table_dec[*c++]) >= 254) { st.eof = 1; /* Treat character '=' as invalid for byte 1: */ break; @@ -28,7 +28,7 @@ ret = 1; break; } - if ((q = base64_table_dec[(unsigned char)*c++]) >= 254) { + if ((q = base64_table_dec[*c++]) >= 254) { st.eof = 1; /* When q == 254, the input char is '='. Return 1 and EOF. * Technically, should check if next byte is also '=', but never mind. @@ -45,7 +45,7 @@ ret = 1; break; } - if ((q = base64_table_dec[(unsigned char)*c++]) >= 254) { + if ((q = base64_table_dec[*c++]) >= 254) { st.eof = 1; /* When q == 254, the input char is '='. Return 1 and EOF. * When q == 255, the input char is invalid. Return 0 and EOF. */ diff --git a/lib/enc/head.c b/lib/enc/head.c index f586822d..36dda07d 100644 --- a/lib/enc/head.c +++ b/lib/enc/head.c @@ -1,7 +1,7 @@ /* Assume that *out is large enough to contain the output. * Theoretically it should be 4/3 the length of src. */ -const unsigned char *c = (unsigned char *)src; -char *o = out; +const unsigned char *c = (const unsigned char *)src; +unsigned char *o = (unsigned char *)out; /* Use local temporaries to avoid cache thrashing: */ size_t outl = 0;