From 008a2b21156a4eac85906d6b4b5e10ca0e4f740f Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 10 Feb 2012 19:32:23 -0800 Subject: Replace computed printf format string with static string Allows format string analysis by gcc & other code checkers. Signed-off-by: Alan Coopersmith Reviewed-by: Mark Kettenis --- listres.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'listres.c') diff --git a/listres.c b/listres.c index c566201..2317473 100644 --- a/listres.c +++ b/listres.c @@ -150,15 +150,13 @@ static void list_known_widgets (void) int i; XmuWidgetNode *wn; int width = 0; - char format[20]; for (i = 0, wn = widget_list; i < nwidgets; i++, wn++) { int l = strlen (wn->label); if (l > width) width = l; } - sprintf (format, "%%-%ds ", width); for (i = 0, wn = widget_list; i < nwidgets; i++, wn++) { - printf (format, wn->label); + printf ("%-*s ", width, wn->label); print_classname (wn, (XmuWidgetNode *) NULL, 0, False); putchar ('\n'); } -- cgit v1.2.3