[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] 05/06: rps tests: be more flexible with logging to
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] 05/06: rps tests: be more flexible with logging to files |
Date: |
Wed, 04 Apr 2018 08:54:50 +0200 |
This is an automated email from the git hooks/post-receive script.
julius-buenger pushed a commit to branch master
in repository gnunet.
commit 2b07d8d5faadac239fee2207b0947a8a8997a124
Author: Julius Bünger <address@hidden>
AuthorDate: Wed Apr 4 08:41:32 2018 +0200
rps tests: be more flexible with logging to files
---
src/rps/rps-test_util.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/rps/rps-test_util.c b/src/rps/rps-test_util.c
index e492b76b7..f57a55155 100644
--- a/src/rps/rps-test_util.c
+++ b/src/rps/rps-test_util.c
@@ -43,6 +43,7 @@ to_file_ (char *file_name, char *line)
{
struct GNUNET_DISK_FileHandle *f;
char output_buffer[512];
+ size_t output_buffer_size = 512;
char *output_buffer_p;
//size_t size;
int size;
@@ -63,16 +64,17 @@ to_file_ (char *file_name, char *line)
file_name);
return;
}
- if (512 < strlen (line) + 18)
+ output_buffer_size = strlen (line) + 18;
+ if (512 < output_buffer_size)
{
- output_buffer_p = GNUNET_malloc ((strlen (line) + 18) * sizeof (char));
+ output_buffer_p = GNUNET_malloc ((output_buffer_size) * sizeof (char));
} else {
output_buffer_p = &output_buffer[0];
}
size = GNUNET_snprintf (output_buffer_p,
- sizeof (output_buffer_p),
+ output_buffer_size,
"%llu %s\n",
- GNUNET_TIME_absolute_get ().abs_value_us,
+ (GNUNET_TIME_absolute_get ().abs_value_us) /
1000000, // microsec -> sec
line);
if (0 > size)
{
@@ -97,7 +99,7 @@ to_file_ (char *file_name, char *line)
return;
}
- if (512 < strlen (line) + 18)
+ if (512 < output_buffer_size)
{
GNUNET_free (output_buffer_p);
}
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnunet] branch master updated (e331d5f6d -> ea51d048c), gnunet, 2018/04/04
- [GNUnet-SVN] [gnunet] 01/06: rps profiler: fix logging of statistic values, gnunet, 2018/04/04
- [GNUnet-SVN] [gnunet] 04/06: rps profiler: change logging format of view sizes, gnunet, 2018/04/04
- [GNUnet-SVN] [gnunet] 02/06: rps service/config: rename option in config, too, gnunet, 2018/04/04
- [GNUnet-SVN] [gnunet] 03/06: rps service: log view size on history update, too, gnunet, 2018/04/04
- [GNUnet-SVN] [gnunet] 05/06: rps tests: be more flexible with logging to files,
gnunet <=
- [GNUnet-SVN] [gnunet] 06/06: rps tests: connect to all services, gnunet, 2018/04/04