From 3ceafc3e134069ecd46df6482e8e7d4b5a7051c3 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 28 Nov 2021 12:49:54 -0800 Subject: PrintProperty: replace sprintf with snprintf Signed-off-by: Alan Coopersmith --- xlsfonts.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xlsfonts.c b/xlsfonts.c index 52d3807..2d8d3f2 100644 --- a/xlsfonts.c +++ b/xlsfonts.c @@ -497,9 +497,8 @@ PrintProperty(XFontProp * prop) atom = XGetAtomName(dpy, prop->name); if (!atom) { + snprintf(nosuch, sizeof(nosuch), "No such atom = %ld", prop->name); atom = nosuch; - nosuch[0] = '\0'; - (void) sprintf(atom, "No such atom = %ld", prop->name); } printf(" %s", atom); -- cgit v1.2.3