From 46d687ab5414f2bd2d55db49be14601054d2fe75 Mon Sep 17 00:00:00 2001 From: Johan Malm Date: Mon, 30 Mar 2026 22:04:01 +0100 Subject: [PATCH] clients/labnag.c: return zero on get_text_size() error Ref: https://github.com/swaywm/sway/pull/9070 --- clients/labnag.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/clients/labnag.c b/clients/labnag.c index 237ee958..82b6e8cd 100644 --- a/clients/labnag.c +++ b/clients/labnag.c @@ -206,6 +206,16 @@ static void get_text_size(cairo_t *cairo, const PangoFontDescription *desc, int *width, int *height, int *baseline, double scale, bool markup, const char *fmt, ...) { + if (width) { + *width = 0; + } + if (height) { + *height = 0; + } + if (baseline) { + *baseline = 0; + } + va_list args; va_start(args, fmt); gchar *buf = g_strdup_vprintf(fmt, args);