[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] branch master updated: revert to simpler size_t, add minimal te
From: |
gnunet |
Subject: |
[gnunet] branch master updated: revert to simpler size_t, add minimal test for parsing '::1;' policy |
Date: |
Sun, 03 Mar 2024 10:13:44 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository gnunet.
The following commit(s) were added to refs/heads/master by this push:
new b28847dc8 revert to simpler size_t, add minimal test for parsing
'::1;' policy
b28847dc8 is described below
commit b28847dc83950fffad1c91672dc5c2c6a3d79c38
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sun Mar 3 10:12:53 2024 +0100
revert to simpler size_t, add minimal test for parsing '::1;' policy
---
src/lib/util/gnunet_error_codes.c | 1 -
src/lib/util/strings.c | 26 +++++++++++++-------------
src/lib/util/test_strings.c | 7 ++++++-
3 files changed, 19 insertions(+), 15 deletions(-)
diff --git a/src/lib/util/gnunet_error_codes.c
b/src/lib/util/gnunet_error_codes.c
index c286f2e52..11ce2d0c8 100644
--- a/src/lib/util/gnunet_error_codes.c
+++ b/src/lib/util/gnunet_error_codes.c
@@ -17,7 +17,6 @@
SPDX-License-Identifier: AGPL3.0-or-later
*/
-#include "platform.h"
#include "gnunet_error_codes.h"
#include <stddef.h>
#include <microhttpd.h>
diff --git a/src/lib/util/strings.c b/src/lib/util/strings.c
index da899f124..fe7a030dd 100644
--- a/src/lib/util/strings.c
+++ b/src/lib/util/strings.c
@@ -37,7 +37,7 @@
#define LOG(kind, ...) GNUNET_log_from (kind, "util-strings", __VA_ARGS__)
#define LOG_STRERROR(kind, syscall) \
- GNUNET_log_from_strerror (kind, "util-strings", syscall)
+ GNUNET_log_from_strerror (kind, "util-strings", syscall)
size_t
@@ -1504,8 +1504,8 @@ GNUNET_STRINGS_parse_ipv6_policy (const char *routeListX)
pos = 0;
for (size_t i = 0; i < count; i++)
{
- ssize_t start;
- ssize_t slash;
+ size_t start;
+ size_t slash;
start = pos;
while (';' != routeList[pos])
@@ -1699,7 +1699,7 @@ GNUNET_STRINGS_base64url_encode (const void *in,
#define cvtfind(a) \
- ((((a) >= 'A') && ((a) <= 'Z')) \
+ ((((a) >= 'A') && ((a) <= 'Z')) \
? (a) - 'A' \
: (((a) >= 'a') && ((a) <= 'z')) \
? (a) - 'a' + 26 \
@@ -1709,15 +1709,15 @@ GNUNET_STRINGS_base64url_encode (const void *in,
#define CHECK_CRLF \
- while ( (data[i] == '\r') || (data[i] == '\n') ) \
- { \
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK, \
- "ignoring CR/LF\n"); \
- i++; \
- if (i >= len) { \
- goto END; \
- } \
- }
+ while ( (data[i] == '\r') || (data[i] == '\n') ) \
+ { \
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK, \
+ "ignoring CR/LF\n"); \
+ i++; \
+ if (i >= len) { \
+ goto END; \
+ } \
+ }
size_t
diff --git a/src/lib/util/test_strings.c b/src/lib/util/test_strings.c
index b39028f45..806324be3 100644
--- a/src/lib/util/test_strings.c
+++ b/src/lib/util/test_strings.c
@@ -43,7 +43,7 @@
#define URLENCODE_TEST_VECTOR_PLAIN "Asbjlaw=ljsdlasjd?人aslkdsa"
#define URLENCODE_TEST_VECTOR_ENCODED \
- "Asbjlaw\%3Dljsdlasjd\%3F\%E4\%BA\%BAaslkdsa"
+ "Asbjlaw\%3Dljsdlasjd\%3F\%E4\%BA\%BAaslkdsa"
int
main (int argc, char *argv[])
@@ -57,6 +57,11 @@ main (int argc, char *argv[])
struct GNUNET_TIME_Relative rt;
struct GNUNET_TIME_Relative rtx;
const char *hdir;
+ struct GNUNET_STRINGS_IPv6NetworkPolicy *pol;
+
+ pol = GNUNET_STRINGS_parse_ipv6_policy ("::1;");
+ GNUNET_assert (NULL != pol);
+ GNUNET_free (pol);
GNUNET_log_setup ("test_strings", "ERROR", NULL);
sprintf (buf, "4 %s", _ (/* size unit */ "b"));
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnunet] branch master updated: revert to simpler size_t, add minimal test for parsing '::1;' policy,
gnunet <=