diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2014-02-18 18:13:43 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2014-02-18 18:13:43 -0800 |
commit | 4768101b52f5e5324208c5c014bac87e0eb28b39 (patch) | |
tree | d4212e1377772200ecaaa52ebc2f105e35248042 | |
parent | 93986e62c7793ef7bb3123748249302e974b72e6 (diff) |
Convert sprintf calls to snprintf
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | xditview.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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); } |