From: des Date: Tue, 30 Oct 2007 10:48:30 +0000 (+0000) Subject: Use a cast to prevent sign extension instead of masking it off after the fact. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf43a31673192be0a2fcd32f484e40aace58db0d;p=varnish Use a cast to prevent sign extension instead of masking it off after the fact. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2193 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/lib/libvarnishapi/shmlog.c b/varnish-cache/lib/libvarnishapi/shmlog.c index 9958534a..67bd40a1 100644 --- a/varnish-cache/lib/libvarnishapi/shmlog.c +++ b/varnish-cache/lib/libvarnishapi/shmlog.c @@ -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");