From: Amos Jeffries Date: Sat, 20 Mar 2010 10:24:23 +0000 (-0600) Subject: Better fix for fromhex() X-Git-Tag: SQUID_3_2_0_1~348 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c6f72b94f7e14e9040c827f61b442d69b49c1d39;p=thirdparty%2Fsquid.git Better fix for fromhex() --- diff --git a/lib/rfc1738.c b/lib/rfc1738.c index e45d140107..9f2ddb27c2 100644 --- a/lib/rfc1738.c +++ b/lib/rfc1738.c @@ -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')