[PATCH:xsm 2/2] Convert a couple last sprintf calls to snprintf
Alan Coopersmith
alan.coopersmith at oracle.com
Thu Jan 13 00:19:46 PST 2011
Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
info.c | 2 +-
save.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/info.c b/info.c
index 2c51fd4..6825765 100644
--- a/info.c
+++ b/info.c
@@ -226,7 +226,7 @@ DisplayProps(ClientRec *client)
XtNstring, buffer.bufStart,
NULL);
- sprintf (buffer.bufStart,
+ snprintf (buffer.bufStart, buffer.bufSize,
"SM Properties : %s", clientListNames[index]);
ptr = Strstr (buffer.bufStart, ") Restart");
diff --git a/save.c b/save.c
index 3cb0c36..a6e0757 100644
--- a/save.c
+++ b/save.c
@@ -420,7 +420,7 @@ SaveOkXtProc(Widget w, XtPointer client_data, XtPointer callData)
{
name_locked = False;
- sprintf (label, "Another session by the name '%s' already exists.\nWould you like to overwrite it?", name);
+ snprintf (label, sizeof(label), "Another session by the name '%s' already exists.\nWould you like to overwrite it?", name);
XtManageChild (nameInUseOverwriteButton);
--
1.7.3.2
More information about the xorg-devel
mailing list