aboutsummaryrefslogtreecommitdiffstats
path: root/src/communication.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-08-03 21:48:21 +0200
committerMattias Andrée <maandree@kth.se>2016-08-03 21:48:21 +0200
commitbe2253d7dd6a5e71719858ddc1479e57a79834a8 (patch)
tree98d833075989488d6bdaf5bcd9ccbab3b86c9a94 /src/communication.h
parentbug fixes (diff)
downloadcoopgammad-be2253d7dd6a5e71719858ddc1479e57a79834a8.tar.gz
coopgammad-be2253d7dd6a5e71719858ddc1479e57a79834a8.tar.bz2
coopgammad-be2253d7dd6a5e71719858ddc1479e57a79834a8.tar.xz
Fix bugs
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/communication.h')
-rw-r--r--src/communication.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/communication.h b/src/communication.h
index 43af314..244ba9d 100644
--- a/src/communication.h
+++ b/src/communication.h
@@ -43,17 +43,17 @@
* @param format:string-literal Message format string
* @param ... Message formatting arguments
*/
-#define MAKE_MESSAGE(bufp, np, extra, format, ...) \
- do \
- { \
- ssize_t m__; \
- snprintf(NULL, 0, format "%zn", __VA_ARGS__, &m__); \
- *(bufp) = malloc((size_t)(extra) + (size_t)m__); \
- if (*(bufp) == NULL) \
- return -1; \
- sprintf(*(bufp), format, __VA_ARGS__); \
- *(np) = (size_t)m__; \
- } \
+#define MAKE_MESSAGE(bufp, np, extra, format, ...) \
+ do \
+ { \
+ ssize_t m__; \
+ snprintf(NULL, 0, format "%zn", __VA_ARGS__, &m__); \
+ *(bufp) = malloc((size_t)(extra) + (size_t)m__ + (size_t)1); \
+ if (*(bufp) == NULL) \
+ return -1; \
+ sprintf(*(bufp), format, __VA_ARGS__); \
+ *(np) = (size_t)m__; \
+ } \
while (0)
/**