From 473236cada3509d429a4740fe05b0ab74b6a5c86 Mon Sep 17 00:00:00 2001 From: phk Date: Mon, 29 Oct 2007 08:24:04 +0000 Subject: [PATCH] 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 --- 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 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"); -- 2.39.5