summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2014-07-11 19:58:18 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2014-07-11 19:58:18 -0700
commitec3e612fadfbdf60dc30bc8f155d5fb6a5fd501f (patch)
tree3a831576bbd8788d14a17fca942f510920609933
parentb23149c5cda460d8ff932e891eb23df897d10dc0 (diff)
Convert sprintf to snprintf
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--xmag.c7
1 files 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);