X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fbase64.c;h=ef8faa452fd3dfb0bd5cbc2049c703600e4c32ef;hb=5635c7575119dffacda891b3f59bf3d2b839e455;hp=0f1b0144baceec439a33d683f5b0ed477daa6f99;hpb=16df176fa4667d17146479219ba8816d89d1d78b;p=libucw.git diff --git a/lib/base64.c b/lib/base64.c index 0f1b0144..ef8faa45 100644 --- a/lib/base64.c +++ b/lib/base64.c @@ -14,19 +14,19 @@ #include -static byte base64_table[] = +static const byte base64_table[] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/', '\0' }; -static byte base64_pad = '='; +static const byte base64_pad = '='; uns -base64_encode(byte *dest, byte *src, uns len) +base64_encode(byte *dest, const byte *src, uns len) { - byte *current = src; + const byte *current = src; uns i = 0; while (len > 2) { /* keep going until we have less than 24 bits */ @@ -58,9 +58,9 @@ base64_encode(byte *dest, byte *src, uns len) /* as above, but backwards. :) */ uns -base64_decode(byte *dest, byte *src, uns len) +base64_decode(byte *dest, const byte *src, uns len) { - byte *current = src; + const byte *current = src; uns ch; uns i = 0, j = 0; static byte reverse_table[256];