summaryrefslogtreecommitdiff
path: root/src/rps/rps-test_util.h
diff options
context:
space:
mode:
authorJulius Bünger <buenger@mytum.de>2019-04-08 16:03:42 +0200
committerJulius Bünger <buenger@mytum.de>2019-04-08 16:03:42 +0200
commit676339f8b08099062248ed297e0e13fa9a9f6e42 (patch)
tree9fe50edc854153f2259708fe42f4d2d2876017d8 /src/rps/rps-test_util.h
parentba49954276e1f04c1d3b6e1861be617882783e54 (diff)
RPS data extraction: Format written files
Diffstat (limited to 'src/rps/rps-test_util.h')
-rw-r--r--src/rps/rps-test_util.h34
1 files changed, 26 insertions, 8 deletions
diff --git a/src/rps/rps-test_util.h b/src/rps/rps-test_util.h
index 6b5f568d7..3094b9bea 100644
--- a/src/rps/rps-test_util.h
+++ b/src/rps/rps-test_util.h
@@ -68,12 +68,21 @@ close_all_files ();
if (NULL == file_name) break; \
size = GNUNET_snprintf(tmp_buf,sizeof(tmp_buf),__VA_ARGS__);\
if (0 > size)\
+ {\
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,\
"Failed to create tmp_buf\n");\
- else\
- GNUNET_DISK_file_write (get_file_handle (file_name),\
- tmp_buf,\
- strnlen (tmp_buf, 512));\
+ break;\
+ }\
+ size = GNUNET_snprintf(tmp_buf,sizeof(tmp_buf),"%s \n", tmp_buf);\
+ if (0 > size)\
+ {\
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,\
+ "Failed to create tmp_buf\n");\
+ break;\
+ }\
+ GNUNET_DISK_file_write (get_file_handle (file_name),\
+ tmp_buf,\
+ strnlen (tmp_buf, 512));\
} while (0);
@@ -82,12 +91,21 @@ close_all_files ();
memset (tmp_buf, 0, len);\
size = GNUNET_snprintf(tmp_buf,sizeof(tmp_buf),__VA_ARGS__);\
if (0 > size)\
+ {\
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,\
+ "Failed to create tmp_buf\n");\
+ break;\
+ }\
+ size = GNUNET_snprintf(tmp_buf,sizeof(tmp_buf),"%s\n", tmp_buf);\
+ if (0 > size)\
+ {\
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,\
"Failed to create tmp_buf\n");\
- else\
- GNUNET_DISK_file_write (get_file_handle (file_name),\
- tmp_buf,\
- strnlen (tmp_buf, 512));\
+ break;\
+ }\
+ GNUNET_DISK_file_write (get_file_handle (file_name),\
+ tmp_buf,\
+ strnlen (tmp_buf, len));\
} while (0);
#else /* TO_FILE */
# define to_file(file_name, ...)