]> err.no Git - varnish/commitdiff
Quench warnings.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 18 Sep 2006 22:03:54 +0000 (22:03 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 18 Sep 2006 22:03:54 +0000 (22:03 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1092 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/lib/libvarnishapi/base64.c

index 2f1b03bc1af12490c8404f87110b509f75501457..b4d3a90644b14d7624e0d0a74703f7cd198d51af 100644 (file)
@@ -6,6 +6,10 @@
  * $Id$
  */
 
+#include <sys/types.h>
+#include <stdint.h>
+#include "varnishapi.h"
+
 static const char *b64 =
     "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
 
@@ -20,7 +24,7 @@ base64_init(void)
        for (i = 0; i < 256; i++)
                i64[i] = -1;
        for (p = b64, i = 0; *p; p++, i++)
-               i64[*p] = i;
+               i64[(int)*p] = i;
        i64['='] = 0;
 }
 
@@ -30,12 +34,13 @@ base64_decode(char *d, unsigned dlen, const char *s)
        unsigned u, v, l;
        int i;
 
+       u = 0;
        l = 0;
        while (*s) {
                for (v = 0; v < 4; v++) {
                        if (!*s)
                                break;
-                       i = i64[*s++];
+                       i = i64[(int)*s++];
                        if (i < 0)
                                return (-1);
                        u <<= 6;
@@ -50,7 +55,6 @@ base64_decode(char *d, unsigned dlen, const char *s)
                        d++;
                }
        }
-       printf("\n");
        *d = '\0';
        return (0);
 }