{
char *s=NULL, *s2=NULL;
size_t sz;
+ int bytes_decoded;
#define ENC(from,want,plus) do { \
s = evhttp_uriencode((from), -1, (plus)); \
free(s);
s = NULL;
+ /* Now try decoding just part of string. */
+ s = malloc(6 + 1 /* NUL byte */);
+ bytes_decoded = evhttp_decode_uri_internal("hello%20%20", 6, s, 0);
+ tt_assert(s);
+ tt_int_op(bytes_decoded,==,6);
+ tt_str_op(s,==,"hello%");
+ free(s);
+ s = NULL;
+
/* Now try out some decoding cases that we don't generate with
* encode_uri: Make sure that malformed stuff doesn't crash... */
DEC("%%xhello th+ere \xff",