]> err.no Git - varnish/commitdiff
Use a cast to prevent sign extension instead of masking it off after the fact.
authordes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 30 Oct 2007 10:48:30 +0000 (10:48 +0000)
committerdes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 30 Oct 2007 10:48:30 +0000 (10:48 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2193 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/lib/libvarnishapi/shmlog.c

index 9958534a6a7db923bf7aca54bf45bf2682a91572..67bd40a1d447ad536408e16234225367e37d3ccc 100644 (file)
@@ -353,7 +353,7 @@ VSL_H_Print(void *priv, enum shmlogtag tag, unsigned fd, unsigned len, unsigned
                        if (*ptr >= ' ' && *ptr <= '~')
                                fprintf(fo, "%c", *ptr);
                        else
-                               fprintf(fo, "%%%02x", (*ptr) & 0xff);
+                               fprintf(fo, "%%%02x", (unsigned char)*ptr);
                        ptr++;
                }
                fprintf(fo, "\"\n");