From bbec1e2f0ef3feea3ac9d922f6242a509ed1edd2 Mon Sep 17 00:00:00 2001 From: Polyakiv-Andrey Date: Mon, 16 Sep 2024 11:11:50 +0300 Subject: [PATCH] The method urlenc_decode was removed --- lib/urlenc.c | 35 ----------------------------------- lib/urlenc.h | 1 - 2 files changed, 36 deletions(-) diff --git a/lib/urlenc.c b/lib/urlenc.c index 3545598..5c2911d 100644 --- a/lib/urlenc.c +++ b/lib/urlenc.c @@ -74,38 +74,3 @@ urlenc_encode(const char *string) ns[strindex] = 0; return (ns); } - -char * -urlenc_decode(const char *string, size_t *olen) -{ - size_t alloc, strindex=0; - char *ns = NULL; - unsigned char in; - long hex; - - if (!string) return NULL; - alloc = strlen(string) + 1; - if ((ns = malloc(alloc)) == NULL) - return (NULL); - - while(--alloc > 0) { - in = *string; - if (('%' == in) && isxdigit(string[1]) && isxdigit(string[2])) { - char hexstr[3]; /* '%XX' */ - hexstr[0] = string[1]; - hexstr[1] = string[2]; - hexstr[2] = 0; - hex = strtol(hexstr, NULL, 16); - in = (unsigned char)hex; /* hex is always < 256 */ - string += 2; - alloc -= 2; - } else if ('+' == in) { - in = ' '; - } - ns[strindex++] = in; - string++; - } - ns[strindex] = 0; - if (olen) *olen = strindex; - return (ns); -} diff --git a/lib/urlenc.h b/lib/urlenc.h index 1fdf2dd..d637150 100644 --- a/lib/urlenc.h +++ b/lib/urlenc.h @@ -12,6 +12,5 @@ #define URLENC_H char *urlenc_encode(const char *string); -char *urlenc_decode(const char *string, size_t *olen); #endif /* URLENC_H */