From: phk Date: Mon, 29 Oct 2007 08:24:04 +0000 (+0000) Subject: Mask negative characters to 8 bit before formatting. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=473236cada3509d429a4740fe05b0ab74b6a5c86;p=varnish Mask negative characters to 8 bit before formatting. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2180 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/lib/libvarnishapi/shmlog.c b/varnish-cache/lib/libvarnishapi/shmlog.c index 2bc9afe0..9958534a 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); + fprintf(fo, "%%%02x", (*ptr) & 0xff); ptr++; } fprintf(fo, "\"\n");