diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-02-10 19:29:05 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-02-10 19:29:05 -0800 |
commit | 57a45f3b7bb745a082e459d965bee2b11e3bd7b6 (patch) | |
tree | b25d30d3d1e9e40977277c21da61ad868e90d840 | |
parent | f08b3613b2fd6995da264ea0a39c6d48dd28bf97 (diff) | |
download | xdpyinfo-57a45f3b7bb745a082e459d965bee2b11e3bd7b6.tar.gz xdpyinfo-57a45f3b7bb745a082e459d965bee2b11e3bd7b6.tar.bz2 xdpyinfo-57a45f3b7bb745a082e459d965bee2b11e3bd7b6.zip |
Convert sprintf calls to snprintf
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | xdpyinfo.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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; } |