Skip to content

Commit

Permalink
http-backend: Let gcc check the format of more printf-type functions.
Browse files Browse the repository at this point in the history
We already have these checks in many printf-type functions that have
prototypes which are in header files.  Add these same checks to
static functions in http-backend.c

Signed-off-by: Tarmigan Casebolt <tarmigan+git@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Tarmigan Casebolt authored and Junio C Hamano committed Nov 16, 2009
1 parent 48aec1b commit 3548701
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions http-backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ static const char *get_parameter(const char *name)
return i ? i->util : NULL;
}

__attribute__((format (printf, 2, 3)))
static void format_write(int fd, const char *fmt, ...)
{
static char buffer[1024];
Expand Down Expand Up @@ -165,6 +166,7 @@ static void end_headers(void)
safe_write(1, "\r\n", 2);
}

__attribute__((format (printf, 1, 2)))
static NORETURN void not_found(const char *err, ...)
{
va_list params;
Expand All @@ -180,6 +182,7 @@ static NORETURN void not_found(const char *err, ...)
exit(0);
}

__attribute__((format (printf, 1, 2)))
static NORETURN void forbidden(const char *err, ...)
{
va_list params;
Expand Down

0 comments on commit 3548701

Please sign in to comment.