summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2014-02-18 18:13:43 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2014-02-18 18:13:43 -0800
commit4768101b52f5e5324208c5c014bac87e0eb28b39 (patch)
treed4212e1377772200ecaaa52ebc2f105e35248042
parent93986e62c7793ef7bb3123748249302e974b72e6 (diff)
Convert sprintf calls to snprintf
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--xditview.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/xditview.c b/xditview.c
index 99fd240..4dae3f9 100644
--- a/xditview.c
+++ b/xditview.c
@@ -324,11 +324,11 @@ DisplayPageNumber (void)
XtSetArg (arg[1], XtNlastPageNumber, &last_page);
XtGetValues (dvi, arg, 2);
if (actual_number == 0)
- sprintf (value, "<none>");
+ snprintf (value, sizeof(value), "<none>");
else if (last_page > 0)
- sprintf (value, "%d of %d", actual_number, last_page);
+ snprintf (value, sizeof(value), "%d of %d", actual_number, last_page);
else
- sprintf (value, "%d", actual_number);
+ snprintf (value, sizeof(value), "%d", actual_number);
text.firstPos = 0;
text.length = strlen (value);
text.ptr = value;
@@ -493,7 +493,7 @@ SetResolutionAction (Widget w, XEvent *xev, String *s, Cardinal *c)
XtSetArg (args[0], XtNscreenResolution, &cur);
XtGetValues (dvi, args, 1);
- sprintf (resolutionBuf, "%d", cur);
+ snprintf (resolutionBuf, sizeof(resolutionBuf), "%d", cur);
MakePrompt (toplevel, "Screen resolution:", NewResolution, resolutionBuf);
}