summaryrefslogtreecommitdiff
path: root/scan_urlencoded_query.c
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2026-10-25 03:28:57 +0100
committerDirk Engling <erdgeist@erdgeist.org>2026-10-25 03:28:57 +0100
commit3a2bb714a43c2930f000dd116868449b4e12a656 (patch)
treea9f28f07e9c0909ef38c3d617ffafc8d8b9192f0 /scan_urlencoded_query.c
parentbda36fcd7b94e752fb5be66572a47e9e010da743 (diff)
Remove unused length calc code from urlencoder
Diffstat (limited to 'scan_urlencoded_query.c')
-rw-r--r--scan_urlencoded_query.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/scan_urlencoded_query.c b/scan_urlencoded_query.c
index cf0c5b1..4825a4a 100644
--- a/scan_urlencoded_query.c
+++ b/scan_urlencoded_query.c
@@ -170,16 +170,12 @@ size_t fmt_urlencoded(char *dest, const uint8_t *src, size_t len) {
170 170
171 /* strchr would find the terminator, so a zero byte never counts as safe */ 171 /* strchr would find the terminator, so a zero byte never counts as safe */
172 if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || (c && strchr(safe, c))) { 172 if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || (c && strchr(safe, c))) {
173 if (dest) 173 dest[written++] = (char)c;
174 dest[written] = (char)c;
175 ++written;
176 } else { 174 } else {
177 if (dest) { 175 dest[written] = '%';
178 dest[written] = '%'; 176 dest[written + 1] = hexdigit[c >> 4];
179 dest[written + 1] = hexdigit[c >> 4]; 177 dest[written + 2] = hexdigit[c & 15];
180 dest[written + 2] = hexdigit[c & 15]; 178 written += 3;
181 }
182 written += 3;
183 } 179 }
184 } 180 }
185 181