From 5fb83c9159727094d3618543669b05cbca02cd5e Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Mon, 17 Feb 2014 16:19:48 +0100 Subject: [PATCH] shl: util: add _shl_sentinel_ marker for strjoin This is very handy to catch wrong usage of shl_strjoin(). We now get a gcc warning if the sentinel (NULL) is omitted. Signed-off-by: David Herrmann --- src/shl_util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shl_util.h b/src/shl_util.h index c9bd849..6ce25fa 100644 --- a/src/shl_util.h +++ b/src/shl_util.h @@ -84,7 +84,7 @@ void *shl_greedy_realloc0(void **mem, size_t *size, size_t need); /* string helpers */ char *shl_strcat(const char *first, const char *second); -char *shl_strjoin(const char *first, ...); +_shl_sentinel_ char *shl_strjoin(const char *first, ...); static inline char *shl_startswith(const char *str, const char *prefix) {