Skip to content

Commit

Permalink
Bug 1197324 - add format-string checking attribute to snprintf_litera…
Browse files Browse the repository at this point in the history
…l. r=froydnj
  • Loading branch information
evilpie committed Aug 3, 2016
1 parent 4b86468 commit e60715f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mfbt/Snprintf.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
// buffer, avoiding the need for the user to pass it in explicitly.
#ifdef __cplusplus
template <size_t N>
#if defined(__GNUC__)
__attribute__((format(printf, 2, 3)))
#endif
int snprintf_literal(char (&buffer)[N], const char* format, ...)
{
va_list args;
Expand Down

0 comments on commit e60715f

Please sign in to comment.