From cf43a31673192be0a2fcd32f484e40aace58db0d Mon Sep 17 00:00:00 2001 From: des Date: Tue, 30 Oct 2007 10:48:30 +0000 Subject: [PATCH] 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 --- varnish-cache/lib/libvarnishapi/shmlog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"); -- 2.39.5