summaryrefslogtreecommitdiff
path: root/xfd.c
diff options
context:
space:
mode:
Diffstat (limited to 'xfd.c')
-rw-r--r--xfd.c45
1 files changed, 23 insertions, 22 deletions
diff --git a/xfd.c b/xfd.c
index bf49d32..18f262f 100644
--- a/xfd.c
+++ b/xfd.c
@@ -316,11 +316,11 @@ main(int argc, char *argv[])
minn = GridFirstChar (fontGrid);
maxn = GridLastChar (fontGrid);
- sprintf (buf, xfd_resources.range_format,
- minn >> 8, minn & 0xff,
- minn >> 8, minn & 0xff,
- maxn >> 8, maxn & 0xff,
- maxn >> 8, maxn & 0xff);
+ snprintf (buf, sizeof(buf), xfd_resources.range_format,
+ minn >> 8, minn & 0xff,
+ minn >> 8, minn & 0xff,
+ maxn >> 8, maxn & 0xff,
+ maxn >> 8, maxn & 0xff);
i = 0;
XtSetArg (av[i], XtNlabel, buf); i++;
@@ -364,11 +364,11 @@ SelectChar(Widget w, XtPointer closure, XtPointer data)
{
XGlyphInfo extents;
XftTextExtents32 (XtDisplay (w), xft, &c, 1, &extents);
- sprintf (buf, xfd_resources.metrics_format,
- extents.xOff, - extents.x,
- extents.xOff - extents.width + extents.x,
- extents.y, extents.height - extents.y,
- xft->ascent, xft->descent);
+ snprintf (buf, sizeof(buf), xfd_resources.metrics_format,
+ extents.xOff, - extents.x,
+ extents.xOff - extents.width + extents.x,
+ extents.y, extents.height - extents.y,
+ xft->ascent, xft->descent);
}
}
else
@@ -389,26 +389,26 @@ SelectChar(Widget w, XtPointer closure, XtPointer data)
char2b.byte2 = p->thechar & 0xff;
XTextExtents16 (fs, &char2b, 1, &direction, &fontascent, &fontdescent,
&metrics);
- sprintf (buf, xfd_resources.metrics_format,
- metrics.width, metrics.lbearing, metrics.rbearing,
- metrics.ascent, metrics.descent, fontascent, fontdescent);
+ snprintf (buf, sizeof(buf), xfd_resources.metrics_format,
+ metrics.width, metrics.lbearing, metrics.rbearing,
+ metrics.ascent, metrics.descent, fontascent, fontdescent);
}
}
XtSetValues (metricsLabel, &arg, ONE);
if (has_char)
{
- sprintf (buf, xfd_resources.select_format,
- n >> 8, n & 0xff,
- n >> 8, n & 0xff,
- n >> 8, n & 0xff);
+ snprintf (buf, sizeof(buf), xfd_resources.select_format,
+ n >> 8, n & 0xff,
+ n >> 8, n & 0xff,
+ n >> 8, n & 0xff);
}
else
{
- sprintf (buf, xfd_resources.nochar_format,
- n >> 8, n & 0xff,
- n >> 8, n & 0xff,
- n >> 8, n & 0xff);
+ snprintf (buf, sizeof(buf), xfd_resources.nochar_format,
+ n >> 8, n & 0xff,
+ n >> 8, n & 0xff,
+ n >> 8, n & 0xff);
}
XtSetValues (selectLabel, &arg, ONE);
@@ -452,7 +452,8 @@ change_page(int page)
unsigned int col = (unsigned int) (newstart & 0xff);
XtSetArg (arg, XtNlabel, buf);
- sprintf (buf, xfd_resources.start_format, newstart, row, col);
+ snprintf (buf, sizeof(buf), xfd_resources.start_format,
+ newstart, row, col);
XtSetValues (startLabel, &arg, ONE);
}