r2193 - trunk/varnish-cache/lib/libvarnishapi

des at projects.linpro.no des at projects.linpro.no
Tue Oct 30 11:48:31 CET 2007


Author: des
Date: 2007-10-30 11:48:30 +0100 (Tue, 30 Oct 2007)
New Revision: 2193

Modified:
   trunk/varnish-cache/lib/libvarnishapi/shmlog.c
Log:
Use a cast to prevent sign extension instead of masking it off after the fact.


Modified: trunk/varnish-cache/lib/libvarnishapi/shmlog.c
===================================================================
--- trunk/varnish-cache/lib/libvarnishapi/shmlog.c	2007-10-30 10:45:28 UTC (rev 2192)
+++ trunk/varnish-cache/lib/libvarnishapi/shmlog.c	2007-10-30 10:48:30 UTC (rev 2193)
@@ -353,7 +353,7 @@
 			if (*ptr >= ' ' && *ptr <= '~')
 				fprintf(fo, "%c", *ptr);
 			else
-				fprintf(fo, "%%%02x", (*ptr) & 0xff);
+				fprintf(fo, "%%%02x", (unsigned char)*ptr);
 			ptr++;
 		}
 		fprintf(fo, "\"\n");




More information about the varnish-commit mailing list