From 13c19f637e4d7b3325f564d20b1aa322830e4fc6 Mon Sep 17 00:00:00 2001 From: david Date: Tue, 28 Aug 2012 14:29:49 +0000 Subject: [PATCH] Add noreturn and format annotations for Ncat logging functions. --- ncat/util.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/ncat/util.h b/ncat/util.h index ed5fed7aa..b5244f6f1 100644 --- a/ncat/util.h +++ b/ncat/util.h @@ -115,14 +115,19 @@ void windows_init(); #include "sockaddr_u.h" -void loguser(const char *fmt, ...); -void loguser_noprefix(const char *fmt, ...); -void logdebug(const char *fmt, ...); +void loguser(const char *fmt, ...) + __attribute__ ((format (printf, 1, 2))); +void loguser_noprefix(const char *fmt, ...) + __attribute__ ((format (printf, 1, 2))); +void logdebug(const char *fmt, ...) + __attribute__ ((format (printf, 1, 2))); /* handle errors */ void die(char *); -void bye(const char *, ...); +void bye(const char *, ...) + __attribute__ ((noreturn)) + __attribute__ ((format (printf, 1, 2))); /* zero out some memory, bzero() is deprecated */ void zmem(void *, size_t); @@ -131,7 +136,8 @@ int strbuf_append(char **buf, size_t *size, size_t *offset, const char *s, size_ int strbuf_append_str(char **buf, size_t *size, size_t *offset, const char *s); -int strbuf_sprintf(char **buf, size_t *size, size_t *offset, const char *fmt, ...); +int strbuf_sprintf(char **buf, size_t *size, size_t *offset, const char *fmt, ...) + __attribute__ ((format (printf, 4, 5))); char *mkstr(const char *start, const char *end);