diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2014-07-11 19:58:18 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2014-07-11 19:58:18 -0700 |
commit | ec3e612fadfbdf60dc30bc8f155d5fb6a5fd501f (patch) | |
tree | 3a831576bbd8788d14a17fca942f510920609933 | |
parent | b23149c5cda460d8ff932e891eb23df897d10dc0 (diff) |
Convert sprintf to snprintf
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | xmag.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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); |