Allows format string analysis by gcc & other code checkers.

Signed-off-by: Alan Coopersmith <[email protected]>
---
 listres.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

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');
     }
-- 
1.7.3.2

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to