]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ctf: sentinelize str_appendn()
authorNick Alcock <nick.alcock@oracle.com>
Mon, 25 Mar 2013 16:43:49 +0000 (16:43 +0000)
committerNick Alcock <nick.alcock@oracle.com>
Mon, 29 Jun 2015 21:41:42 +0000 (22:41 +0100)
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 <nick.alcock@oracle.com>
scripts/dwarf2ctf/dwarf2ctf.c

index 8726b652ef3a93f01fcae1cb3dfe922361dfd7c7..beca89222abf58532cff1c0dc2914436f6f490e2 100644 (file)
@@ -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().