]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Better fix for fromhex()
authorAmos Jeffries <amosjeffries@squid-cache.org>
Sat, 20 Mar 2010 10:24:23 +0000 (04:24 -0600)
committerAmos Jeffries <amosjeffries@squid-cache.org>
Sat, 20 Mar 2010 10:24:23 +0000 (04:24 -0600)
lib/rfc1738.c

index e45d140107b48bcb06f0f6e14314935405c15593..9f2ddb27c2953d2deae14f417804c3f75881dcc3 100644 (file)
@@ -133,7 +133,7 @@ rfc1738_do_escape(const char *url, int flags)
          * allocated - KA */
 
         if (do_escape == 1) {
-            (void) sprintf(q, "%%%02X", (unsigned char) *p);
+            (void) snprintf(q, 3, "%%%02X", (unsigned char) *p);
             q += sizeof(char) * 2;
         } else {
             *q = *p;
@@ -178,9 +178,9 @@ rfc1738_escape_part(const char *url)
 /*
  * Converts a ascii hex code into a binary character.
  */
-inline int fromhex(char ch); /* prototype to keep GCC happy. */
+/* int fromhex(char ch); *//* prototype to keep GCC happy. */
 
-inline int
+static int
 fromhex(char ch)
 {
     if (ch >= '0' && ch <= '9')