summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-02-10 19:29:05 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2013-02-10 19:29:05 -0800
commit57a45f3b7bb745a082e459d965bee2b11e3bd7b6 (patch)
treeb25d30d3d1e9e40977277c21da61ad868e90d840
parentf08b3613b2fd6995da264ea0a39c6d48dd28bf97 (diff)
Convert sprintf calls to snprintf
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--xdpyinfo.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/xdpyinfo.c b/xdpyinfo.c
index def5ee6..3233b19 100644
--- a/xdpyinfo.c
+++ b/xdpyinfo.c
@@ -336,7 +336,8 @@ print_display_info(Display *dpy)
case LSBFirst: cp = "LSBFirst"; break;
case MSBFirst: cp = "MSBFirst"; break;
default:
- sprintf (dummybuf, "unknown order %d", BitmapBitOrder (dpy));
+ snprintf (dummybuf, sizeof(dummybuf),
+ "unknown order %d", BitmapBitOrder (dpy));
cp = dummybuf;
break;
}
@@ -347,7 +348,8 @@ print_display_info(Display *dpy)
case LSBFirst: cp = "LSBFirst"; break;
case MSBFirst: cp = "MSBFirst"; break;
default:
- sprintf (dummybuf, "unknown order %d", ImageByteOrder (dpy));
+ snprintf (dummybuf, sizeof(dummybuf),
+ "unknown order %d", ImageByteOrder (dpy));
cp = dummybuf;
break;
}
@@ -421,7 +423,7 @@ print_visual_info(XVisualInfo *vip)
case TrueColor: class = "TrueColor"; break;
case DirectColor: class = "DirectColor"; break;
default:
- sprintf (errorbuf, "unknown class %d", vip->class);
+ snprintf (errorbuf, sizeof(errorbuf), "unknown class %d", vip->class);
class = errorbuf;
break;
}