gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] branch master updated: - fix multibyte urlencode


From: gnunet
Subject: [gnunet] branch master updated: - fix multibyte urlencode
Date: Sun, 02 Aug 2020 08:56:42 +0200

This is an automated email from the git hooks/post-receive script.

martin-schanzenbach pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 8ed78400d - fix multibyte urlencode
8ed78400d is described below

commit 8ed78400d419a6a87df2596ed77849870494506c
Author: Martin Schanzenbach <mschanzenbach@posteo.de>
AuthorDate: Sun Aug 2 08:50:33 2020 +0200

    - fix multibyte urlencode
---
 src/util/strings.c      | 2 +-
 src/util/test_strings.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/util/strings.c b/src/util/strings.c
index d5e2f4878..9d6f4039e 100644
--- a/src/util/strings.c
+++ b/src/util/strings.c
@@ -2184,7 +2184,7 @@ GNUNET_STRINGS_urlencode (const char *data, size_t len, 
char **out)
     if (0x80 + 0x40 + 0x20 == ((0x80 + 0x40 + 0x20 + 0x10) & *i8))
     {
       /* 3-byte value, percent-encode */
-      for (unsigned int i = 0; i<4; i++)
+      for (unsigned int i = 0; i<3; i++)
       {
         GNUNET_buffer_write_fstr (&buf,
                                   "%%%X%X",
diff --git a/src/util/test_strings.c b/src/util/test_strings.c
index 28b1bb6f8..753ec6908 100644
--- a/src/util/test_strings.c
+++ b/src/util/test_strings.c
@@ -39,9 +39,9 @@
 #define WANTB(a, b, l) if (0 != memcmp (a, b, l)) { GNUNET_break (0); return 
1; \
 } else { }
 
-#define URLENCODE_TEST_VECTOR_PLAIN "Asbjlaw=ljsdlasjd?aslkdsa"
+#define URLENCODE_TEST_VECTOR_PLAIN "Asbjlaw=ljsdlasjd?人aslkdsa"
 
-#define URLENCODE_TEST_VECTOR_ENCODED "Asbjlaw\%3Dljsdlasjd\%3Faslkdsa"
+#define URLENCODE_TEST_VECTOR_ENCODED 
"Asbjlaw\%3Dljsdlasjd\%3F\%E4\%BA\%BAaslkdsa"
 
 int
 main (int argc, char *argv[])

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]