Add a printf annotation of the log_error function

This commit is contained in:
Kovid Goyal
2018-07-13 16:39:47 +05:30
parent 55556aaac4
commit 5a85c890ba
2 changed files with 2 additions and 2 deletions

View File

@@ -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;

View File

@@ -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;
}