about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--base64.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/base64.c b/base64.c
index 6bf3b4b..0771e0d 100644
--- a/base64.c
+++ b/base64.c
@@ -58,13 +58,12 @@ static void usage(const char *name) {
     fprintf(stderr, "usage: %s [-d] [FILE]\n", name);
 }
 
-char *base64(char *i, ssize_t length, unsigned dflg){
-    /* TODO: support Unicode */
+char *base64(unsigned char *i, ssize_t length, unsigned dflg){
     if (dflg) return NULL;
     char *out = malloc(length/3 * 4 + 100);
     int o = 0; /* index of position in out */
     while (length > 0) {
-        char i1, i2;
+        unsigned char i1, i2;
         i1 = i2 = 0;
         length -= 3;
         if (length >= -2) {
@@ -139,7 +138,7 @@ int main(int argc, char **argv) {
         }
     }
     ssize_t bytes;
-    char buf[BUF_SIZE] = {'\0'};
+    unsigned char buf[BUF_SIZE] = {'\0'};
     while (1){
         if ((bytes = read(fd, buf, BUF_SIZE)) <= 0 ) {
             if (bytes == 0) break; /* read returns 0 when EOF has been reached */