diff options
-rw-r--r-- | src/Selection.c | 2 | ||||
-rw-r--r-- | src/Shell.c | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/Selection.c b/src/Selection.c index 1759c02..101ea6a 100644 --- a/src/Selection.c +++ b/src/Selection.c @@ -226,7 +226,7 @@ static Atom GetSelectionProperty( propCount = sarray->propCount++; sarray->list = (SelectionProp) XtRealloc((XtPointer)sarray->list, (unsigned)(sarray->propCount*sizeof(SelectionPropRec))); - (void) sprintf(propname, "%s%d", "_XT_SELECTION_", propCount); + (void) snprintf(propname, sizeof(propname), "_XT_SELECTION_%d", propCount); sarray->list[propCount].prop = XInternAtom(dpy, propname, FALSE); sarray->list[propCount].avail = FALSE; return(sarray->list[propCount].prop); diff --git a/src/Shell.c b/src/Shell.c index 732e978..ef6dad2 100644 --- a/src/Shell.c +++ b/src/Shell.c @@ -1780,7 +1780,8 @@ static void GetGeometry( } else hints.flags = 0; - sprintf( def_geom, "%dx%d+%d+%d", width, height, x, y ); + snprintf( def_geom, sizeof(def_geom), "%dx%d+%d+%d", + width, height, x, y ); flag = XWMGeometry( XtDisplay(W), XScreenNumberOfScreen(XtScreen(W)), w->shell.geometry, def_geom, @@ -3013,7 +3014,7 @@ static void SetSessionProperties( user_name = _XtGetUserName(nam_buf, sizeof nam_buf); if (user_name) props[num_props++] = ArrayPack(SmUserID, &user_name); - sprintf(pid, "%ld", (long)getpid()); + snprintf(pid, sizeof(pid), "%ld", (long)getpid()); props[num_props++] = ArrayPack(SmProcessID, &pidp); if (num_props) { |