From: Darafei Praliaskouski Date: Thu, 7 May 2026 21:14:40 +0000 (+0400) Subject: fix(gtk): bound formatter output X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=refs%2Fpull%2F596%2Fhead;p=thirdparty%2Fmtr.git fix(gtk): bound formatter output --- diff --git a/ui/gtk.c b/ui/gtk.c index 742c5c9..8ec952a 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -356,7 +356,7 @@ static void float_formatter( gfloat f; gchar text[64]; gtk_tree_model_get(tree_model, iter, POINTER_TO_INT(data), &f, -1); - sprintf(text, "%.2f", f); + snprintf(text, sizeof(text), "%.2f", f); g_object_set(cell, "text", text, NULL); } @@ -370,7 +370,7 @@ static void percent_formatter( gfloat f; gchar text[64]; gtk_tree_model_get(tree_model, iter, POINTER_TO_INT(data), &f, -1); - sprintf(text, "%.1f%%", f); + snprintf(text, sizeof(text), "%.1f%%", f); g_object_set(cell, "text", text, NULL); }