From a13ada02dc89f7d0751bccaf909fa7d6ddd5860f Mon Sep 17 00:00:00 2001 From: Nick Alcock Date: Mon, 25 Mar 2013 16:43:49 +0000 Subject: [PATCH] ctf: sentinelize str_appendn() str_appendn() takes a variable argument list of items to append, terminated by a NULL. Every single time I have used it, I have forgotten the NULL. Add a sentinel attribute to make it harder to forget in future. Signed-off-by: Nick Alcock --- scripts/dwarf2ctf/dwarf2ctf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/dwarf2ctf/dwarf2ctf.c b/scripts/dwarf2ctf/dwarf2ctf.c index 8726b652ef3a..beca89222abf 100644 --- a/scripts/dwarf2ctf/dwarf2ctf.c +++ b/scripts/dwarf2ctf/dwarf2ctf.c @@ -592,7 +592,8 @@ static char *str_append(char *s, const char *append) /* * A vararg string appender. */ -static char *str_appendn(char *s, ...) __attribute__((__warn_unused_result__)); +static char *str_appendn(char *s, ...) + __attribute__((__warn_unused_result__, sentinel)); /* * An error-checking strdup(). -- 2.50.1