From 3a2bb714a43c2930f000dd116868449b4e12a656 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Sun, 25 Oct 2026 03:28:57 +0100 Subject: Remove unused length calc code from urlencoder --- scan_urlencoded_query.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'scan_urlencoded_query.c') 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) { /* strchr would find the terminator, so a zero byte never counts as safe */ if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || (c && strchr(safe, c))) { - if (dest) - dest[written] = (char)c; - ++written; + dest[written++] = (char)c; } else { - if (dest) { - dest[written] = '%'; - dest[written + 1] = hexdigit[c >> 4]; - dest[written + 2] = hexdigit[c & 15]; - } - written += 3; + dest[written] = '%'; + dest[written + 1] = hexdigit[c >> 4]; + dest[written + 2] = hexdigit[c & 15]; + written += 3; } } -- cgit v1.3