diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-10-20 11:52:43 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-11-01 22:17:31 -0700 |
commit | 2458580ac95c550217b3376c46eecb2cca646241 (patch) | |
tree | 20285050ebc21a8068e732b3ba2be31adc5579d8 /geometry.c | |
parent | 3ed68e06cb45fb526b09e4c7b7c3d60de552b2b3 (diff) |
Convert remaining sprintf calls to snprintf
Most were fixed length or length checked anyway, this just saves time
doublechecking that. (A few could be replaced by asprintf, but we
don't have a copy guaranteed to be reachable from this program yet.)
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
Diffstat (limited to 'geometry.c')
-rw-r--r-- | geometry.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -258,9 +258,9 @@ ddText(Display * dpy, DoodadInfo * di) } if (di->section) { - sprintf(buf, "%s in section %s", - XkbAtomText(dpy, di->name, XkbMessage), scText(dpy, - di->section)); + snprintf(buf, sizeof(buf), "%s in section %s", + XkbAtomText(dpy, di->name, XkbMessage), + scText(dpy, di->section)); return buf; } return XkbAtomText(dpy, di->name, XkbMessage); @@ -3297,8 +3297,8 @@ FontFromParts(Atom fontTok, rtrn = uCalloc(totalSize, 1); if (rtrn) { - sprintf(rtrn, FONT_TEMPLATE, font, weight, slant, setWidth, variant, - size, encoding); + snprintf(rtrn, totalSize, FONT_TEMPLATE, font, weight, slant, + setWidth, variant, size, encoding); } return rtrn; } |