Skip to content

Commit

Permalink
Add GCC format checking attributes to minidriver logging function
Browse files Browse the repository at this point in the history
Commit "Add GCC format checking attributes to log functions" added format
and parameter checking to OpenSC log functions.
Minidriver, however, logs most of its output via a dedicated log function,
so this function needs such attributes, too.

Signed-off-by: Maciej S. Szmigiero <[email protected]>
  • Loading branch information
maciejsszmigiero committed Jan 28, 2017
1 parent ee8f1cc commit 6f2bbf5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/minidriver/minidriver.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,11 @@ static void md_fs_finalize(PCARD_DATA pCardData);
#define snprintf _snprintf
#endif

#if defined(__GNUC__)
static void logprintf(PCARD_DATA pCardData, int level, const char* format, ...)
__attribute__ ((format (SC_PRINTF_FORMAT, 3, 4)));
#endif

static void logprintf(PCARD_DATA pCardData, int level, _Printf_format_string_ const char* format, ...)
{
va_list arg;
Expand Down

0 comments on commit 6f2bbf5

Please sign in to comment.