common/pango: log on get_text_size()/render_text() format failure

This commit is contained in:
Simon Ser 2026-03-14 13:09:52 +01:00 committed by Alexander Orzechowski
parent 2c2a2ec380
commit 9d0dbe66c3

View file

@ -91,6 +91,7 @@ void get_text_size(cairo_t *cairo, const PangoFontDescription *desc, int *width,
char *buf = vformat_str(fmt, args); char *buf = vformat_str(fmt, args);
va_end(args); va_end(args);
if (buf == NULL) { if (buf == NULL) {
sway_log(SWAY_ERROR, "Failed to format string");
return; return;
} }
@ -127,6 +128,7 @@ void render_text(cairo_t *cairo, const PangoFontDescription *desc,
char *buf = vformat_str(fmt, args); char *buf = vformat_str(fmt, args);
va_end(args); va_end(args);
if (buf == NULL) { if (buf == NULL) {
sway_log(SWAY_ERROR, "Failed to format string");
return; return;
} }