diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2005-03-31 05:07:56 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2005-03-31 05:07:56 +0000 |
commit | 602849ac982c63a2de717f69058c3b0e63e64207 (patch) | |
tree | af61d5b327a42cbfb18247e4c420d157690cb637 /display.c | |
parent | bb49dac05bb4598f86bbeea5c41c4c26221927e4 (diff) | |
download | gpsd-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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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]) { |