From ec3e612fadfbdf60dc30bc8f155d5fb6a5fd501f Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 11 Jul 2014 19:58:18 -0700 Subject: Convert sprintf to snprintf Signed-off-by: Alan Coopersmith --- xmag.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/xmag.c b/xmag.c index cf047a5..0fca602 100644 --- a/xmag.c +++ b/xmag.c @@ -366,9 +366,10 @@ UpdatePixelAP(Widget w, XEvent *event, String *params, Cardinal *num_params) else { color.pixel = pixel; XQueryColor(dpy, data->win_info.colormap, &color); - sprintf(string, "Pixel %ld at (%d,%d) colored (%x,%x,%x).", - pixel, x + data->x, y + data->y, - color.red, color.green, color.blue); + snprintf(string, sizeof(string), + "Pixel %ld at (%d,%d) colored (%x,%x,%x).", + pixel, x + data->x, y + data->y, + color.red, color.green, color.blue); n = 0; XtSetArg(wargs[n], XtNlabel, string); n++; XtSetValues(data->pixLabel, wargs, n); -- cgit v1.2.3