From 5a85c890ba8237856f325f60271df91fa3b253a0 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 13 Jul 2018 16:39:47 +0530 Subject: [PATCH] Add a printf annotation of the log_error function --- kitty/data-types.h | 2 +- kitty/fonts.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kitty/data-types.h b/kitty/data-types.h index cc9589b98..a6b5609b7 100644 --- a/kitty/data-types.h +++ b/kitty/data-types.h @@ -27,7 +27,7 @@ #define xstr(s) str(s) #define str(s) #s #define arraysz(x) (sizeof(x)/sizeof(x[0])) -void log_error(const char *fmt, ...); +void log_error(const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); #define fatal(...) { log_error(__VA_ARGS__); exit(EXIT_FAILURE); } typedef unsigned long long id_type; diff --git a/kitty/fonts.c b/kitty/fonts.c index 9f5cc2b9d..600475039 100644 --- a/kitty/fonts.c +++ b/kitty/fonts.c @@ -1105,7 +1105,7 @@ initialize_font(FontGroup *fg, unsigned int desc_idx, const char *ftype) { Py_CLEAR(face); if (!ok) { if (PyErr_Occurred()) { PyErr_Print(); } - fatal("Failed to initialize %s font: %d", ftype, idx); + fatal("Failed to initialize %s font: %zu", ftype, idx); } return idx; }