From 57a45f3b7bb745a082e459d965bee2b11e3bd7b6 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 10 Feb 2013 19:29:05 -0800 Subject: Convert sprintf calls to snprintf Signed-off-by: Alan Coopersmith --- xdpyinfo.c | 8 +++++--- 1 file 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; } -- cgit v1.2.3