]> git.cameronkatri.com Git - mandoc.git/commitdiff
drop redundant '0' flag from "%02.2X" format string;
authorIngo Schwarze <schwarze@openbsd.org>
Wed, 6 Mar 2019 12:32:41 +0000 (12:32 +0000)
committerIngo Schwarze <schwarze@openbsd.org>
Wed, 6 Mar 2019 12:32:41 +0000 (12:32 +0000)
found by a compiler warning from gcc 4.9.2 on Linux

cgi.c

diff --git a/cgi.c b/cgi.c
index 812e77012f2398d1dc45ec9e951cd612b6f6c670..0af0f1255d4094bfb8887806ff8aac2f29837c5d 100644 (file)
--- a/cgi.c
+++ b/cgi.c
@@ -1,4 +1,4 @@
-/*     $Id: cgi.c,v 1.165 2019/01/31 23:00:23 schwarze Exp $ */
+/*     $Id: cgi.c,v 1.166 2019/03/06 12:32:41 schwarze Exp $ */
 /*
  * Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2014, 2015, 2016, 2017, 2018 Ingo Schwarze <schwarze@usta.de>
@@ -324,7 +324,7 @@ http_encode(const char *p)
        for (; *p != '\0'; p++) {
                if (isalnum((unsigned char)*p) == 0 &&
                    strchr("-._~", *p) == NULL)
-                       printf("%%%02.2X", (unsigned char)*p);
+                       printf("%%%2.2X", (unsigned char)*p);
                else
                        putchar(*p);
        }