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);
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, ...)