From 185bee5366b26db3788d1486bb15e9b46f344771 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Sat, 24 Oct 2026 05:48:37 +0200 Subject: Add a url escaper next to the scanner --- scan_urlencoded_query.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'scan_urlencoded_query.h') diff --git a/scan_urlencoded_query.h b/scan_urlencoded_query.h index 74246e7..6f12c03 100644 --- a/scan_urlencoded_query.h +++ b/scan_urlencoded_query.h @@ -6,6 +6,8 @@ #ifndef SCAN_URLENCODED_QUERY_H__ #define SCAN_URLENCODED_QUERY_H__ +#include +#include #include typedef struct { @@ -52,4 +54,10 @@ void scan_urlencoded_skipvalue(char **string); */ ssize_t scan_fixed_int(char *data, size_t len, int *number); +/* The other direction: percent encode len bytes from src into dest and return + how many characters were written, or how many would be needed when dest is + NULL. dest needs room for three times len. + */ +size_t fmt_urlencoded(char *dest, const uint8_t *src, size_t len); + #endif -- cgit v1.3