summaryrefslogtreecommitdiff
path: root/display.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2005-03-31 05:07:56 +0000
committerEric S. Raymond <esr@thyrsus.com>2005-03-31 05:07:56 +0000
commit602849ac982c63a2de717f69058c3b0e63e64207 (patch)
treeaf61d5b327a42cbfb18247e4c420d157690cb637 /display.c
parentbb49dac05bb4598f86bbeea5c41c4c26221927e4 (diff)
downloadgpsd-602849ac982c63a2de717f69058c3b0e63e64207.tar.gz
OK, let's try this again. Only you can prevent malicious buffer overruns!
Diffstat (limited to 'display.c')
-rw-r--r--display.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/display.c b/display.c
index f9ef97f0..33fe36e9 100644
--- a/display.c
+++ b/display.c
@@ -25,7 +25,7 @@ static void set_color(String color)
if (!XAllocNamedColor(dpy, cmap, color, &col, &unused)) {
char buf[32];
- sprintf(buf, "Can't alloc %s", color);
+ snprintf(buf, sizeof(buf), "Can't alloc %s", color);
XtWarning(buf);
return;
}
@@ -119,7 +119,7 @@ void draw_graphics(struct gps_data_t *gpsdata)
11, 11, /* width, height */
0, 360 * 64 /* angle1, angle2 */
);
- sprintf(buf, "%02d", gpsdata->PRN[i]);
+ snprintf(buf, sizeof(buf), "%02d", gpsdata->PRN[i]);
set_color("Blue");
XDrawString(XtDisplay(draww), pixmap, drawGC, x, y + 17, buf, 2);
if (gpsdata->ss[i]) {