gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] branch master updated: GNS: Test vector output nicer


From: gnunet
Subject: [gnunet] branch master updated: GNS: Test vector output nicer
Date: Thu, 29 Jun 2023 09:31:24 +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 ce6160020 GNS: Test vector output nicer
ce6160020 is described below

commit ce6160020ff0d24012ccd288653197e45936a287
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Thu Jun 29 09:31:06 2023 +0200

    GNS: Test vector output nicer
---
 src/gnsrecord/gnunet-gnsrecord-tvg.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/gnsrecord/gnunet-gnsrecord-tvg.c 
b/src/gnsrecord/gnunet-gnsrecord-tvg.c
index 4822141f9..16c917b24 100644
--- a/src/gnsrecord/gnunet-gnsrecord-tvg.c
+++ b/src/gnsrecord/gnunet-gnsrecord-tvg.c
@@ -71,8 +71,13 @@ print_bytes_ (void *buf,
 
   for (i = 0; i < buf_len; i++)
   {
-    if ((0 != i) && (0 != fold) && (i % fold == 0))
-      printf ("\n");
+    if (0 != i)
+    {
+      if ((0 != fold) && (i % fold == 0))
+        printf ("\n");
+      else
+        printf (" ");
+    }
     if (in_be)
       printf ("%02x", ((unsigned char*) buf)[buf_len - 1 - i]);
     else
@@ -100,13 +105,14 @@ print_record (const struct GNUNET_GNSRECORD_Data *rd)
   uint64_t abs_nbo = GNUNET_htonll (rd->expiration_time);
   uint16_t size_nbo = htons (rd->data_size);
   uint32_t type_nbo = htonl (rd->record_type);
+  at.abs_value_us = GNUNET_ntohll (abs_nbo);
   if (0 != (rd->flags & GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION))
   {
     rt.rel_value_us = rd->expiration_time;
     at = GNUNET_TIME_relative_to_absolute (rt);
     abs_nbo = GNUNET_htonll (at.abs_value_us);
   }
-  printf ("EXPIRATION:\n");
+  printf ("EXPIRATION: %" PRIu64 " us\n", rd->expiration_time);
   print_bytes (&abs_nbo, sizeof (abs_nbo), 8);
   printf ("\nDATA_SIZE:\n");
   print_bytes (&size_nbo, sizeof (size_nbo), 8);

-- 
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]