diff options
Diffstat (limited to 'src/rps/rps-test_util.h')
-rw-r--r-- | src/rps/rps-test_util.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/rps/rps-test_util.h b/src/rps/rps-test_util.h index e8e352ff6..725be815c 100644 --- a/src/rps/rps-test_util.h +++ b/src/rps/rps-test_util.h | |||
@@ -58,8 +58,18 @@ create_file (const char *name); | |||
58 | else\ | 58 | else\ |
59 | to_file_(file_name,tmp_buf);\ | 59 | to_file_(file_name,tmp_buf);\ |
60 | } while (0); | 60 | } while (0); |
61 | # define to_file_w_len(file_name, len, ...) do {char tmp_buf[len];\ | ||
62 | int size;\ | ||
63 | size = GNUNET_snprintf(tmp_buf,sizeof(tmp_buf),__VA_ARGS__);\ | ||
64 | if (0 > size)\ | ||
65 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING,\ | ||
66 | "Failed to create tmp_buf\n");\ | ||
67 | else\ | ||
68 | to_file_(file_name,tmp_buf);\ | ||
69 | } while (0); | ||
61 | #else /* TO_FILE */ | 70 | #else /* TO_FILE */ |
62 | # define to_file(file_name, ...) | 71 | # define to_file(file_name, ...) |
72 | # define to_file_w_len(file_name, len, ...) | ||
63 | #endif /* TO_FILE */ | 73 | #endif /* TO_FILE */ |
64 | 74 | ||
65 | #endif /* RPS_TEST_UTIL_H */ | 75 | #endif /* RPS_TEST_UTIL_H */ |