summaryrefslogtreecommitdiff
path: root/xsm.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2007-11-26 13:21:18 -0800
committerAlan Coopersmith <alan.coopersmith@sun.com>2007-11-26 13:21:18 -0800
commit6f4560e2ad81736127d2d3544415a05d41e8a2a7 (patch)
tree6c53b2585d1081cf9296c09cd22acee1e9ac9a4f /xsm.c
parentfab9dcb15024996ac3a4f94d65ba73f484820534 (diff)
Use snprintf, strdup & remove instead of sprintf, malloc/strcpy & unlink
Diffstat (limited to 'xsm.c')
-rw-r--r--xsm.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/xsm.c b/xsm.c
index 15304ba..4a95bd2 100644
--- a/xsm.c
+++ b/xsm.c
@@ -358,7 +358,8 @@ SetWM_DELETE_WINDOW(Widget widget, String delAction)
{
char translation[64];
- sprintf (translation, "<Message>WM_PROTOCOLS: %s", delAction);
+ snprintf (translation, sizeof(translation),
+ "<Message>WM_PROTOCOLS: %s", delAction);
XtOverrideTranslations (widget, XtParseTranslationTable (translation));
XSetWMProtocols (XtDisplay(widget), XtWindow (widget),
@@ -495,7 +496,7 @@ StartSession(char *name, Bool use_default)
* Set the main window's title to the session name.
*/
- sprintf (title, "xsm: %s", name);
+ snprintf (title, sizeof(title), "xsm: %s", name);
XtVaSetValues (topLevel,
XtNtitle, title, /* session name */