summaryrefslogtreecommitdiff
path: root/xdpyinfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'xdpyinfo.c')
-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;
}