From c6f72b94f7e14e9040c827f61b442d69b49c1d39 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Sat, 20 Mar 2010 04:24:23 -0600 Subject: [PATCH] Better fix for fromhex() --- lib/rfc1738.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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') -- 2.47.2