Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/libexec/httpd avoid sign extension in % handling (and printi...



details:   https://anonhg.NetBSD.org/src/rev/abbbfe781369
branches:  trunk
changeset: 446392:abbbfe781369
user:      mrg <mrg%NetBSD.org@localhost>
date:      Tue Dec 04 00:26:15 2018 +0000

description:
avoid sign extension in % handling (and printing 0xFFFFFF before
wanted values.)  from Rajeev V. Pillai.

diffstat:

 libexec/httpd/bozohttpd.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r 7331b3dcfb0e -r abbbfe781369 libexec/httpd/bozohttpd.c
--- a/libexec/httpd/bozohttpd.c Tue Dec 04 00:18:05 2018 +0000
+++ b/libexec/httpd/bozohttpd.c Tue Dec 04 00:26:15 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bozohttpd.c,v 1.99 2018/11/25 07:37:20 mrg Exp $       */
+/*     $NetBSD: bozohttpd.c,v 1.100 2018/12/04 00:26:15 mrg Exp $      */
 
 /*     $eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $      */
 
@@ -1023,7 +1023,7 @@
                case '\r':
                case ' ':
                encode_it:
-                       snprintf(d, 4, "%%%02X", *s++);
+                       snprintf(d, 4, "%%%02X", (unsigned char)*s++);
                        d += 3;
                        len += 3;
                        break;



Home | Main Index | Thread Index | Old Index