]> mj.ucw.cz Git - libucw.git/blobdiff - lib/base64.c
Empty final bucket should be turned into a file as well.
[libucw.git] / lib / base64.c
index fe1a7c4c0fb21c63d735366c6bfa428ce6825a28..0f1b0144baceec439a33d683f5b0ed477daa6f99 100644 (file)
@@ -1,8 +1,10 @@
 /*
- *     Base 64 Encoding & Decoding
+ *     UCW Library -- Base 64 Encoding & Decoding
  *
  *     (c) 2002, Robert Spalek <robert@ucw.cz>
  *
+ *     This software may be freely distributed and used according to the terms
+ *     of the GNU Lesser General Public License.
  */
 
 #undef LOCAL_DEBUG
@@ -59,7 +61,7 @@ uns
 base64_decode(byte *dest, byte *src, uns len)
 {
        byte *current = src;
-       byte ch;
+       uns ch;
        uns i = 0, j = 0;
        static byte reverse_table[256];
        static uns table_built = 0;
@@ -91,7 +93,7 @@ base64_decode(byte *dest, byte *src, uns len)
                   headache.  - Turadg Aleahmad <turadg@wise.berkeley.edu>
                 */
 
-               if (ch == ' ') ch = '+'; 
+               if (ch == ' ') ch = '+';
 
                ch = reverse_table[ch];
                if (ch == 0xff) continue;