From: Sami Kerola Date: Wed, 25 Jul 2012 19:15:34 +0000 (+0200) Subject: include: define format to be constant in xasprintf() X-Git-Tag: v2.22-rc1~45 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d0aa8a446deaabfcc162a7af97ab24e6bd8440bc;p=thirdparty%2Futil-linux.git include: define format to be constant in xasprintf() Add also format function attribute to add robustness. Signed-off-by: Sami Kerola --- diff --git a/include/xalloc.h b/include/xalloc.h index 8c22ff76a9..1704259bca 100644 --- a/include/xalloc.h +++ b/include/xalloc.h @@ -63,7 +63,8 @@ static inline char *xstrdup(const char *str) return ret; } -static inline int xasprintf(char **strp, char *fmt, ...) +static inline int __attribute__ ((__format__(printf, 2, 3))) + xasprintf(char **strp, const char *fmt, ...) { int ret; va_list args;