summaryrefslogtreecommitdiff
path: root/hw/dmx
diff options
context:
space:
mode:
Diffstat (limited to 'hw/dmx')
-rw-r--r--hw/dmx/examples/ev.c4
-rw-r--r--hw/dmx/glxProxy/glxscreens.c5
2 files changed, 5 insertions, 4 deletions
diff --git a/hw/dmx/examples/ev.c b/hw/dmx/examples/ev.c
index ba45c2b25..ed23b8aa9 100644
--- a/hw/dmx/examples/ev.c
+++ b/hw/dmx/examples/ev.c
@@ -60,7 +60,7 @@ int main(int argc, char **argv)
#define test_bit(bit) (mask[(bit)/8] & (1 << ((bit)%8)))
for (i = 0; i < 32; i++) {
- sprintf(name, "/dev/input/event%d", i);
+ snprintf(name, sizeof(name), "/dev/input/event%d", i);
if ((fd = open(name, O_RDONLY, 0)) >= 0) {
ioctl(fd, EVIOCGVERSION, &version);
ioctl(fd, EVIOCGNAME(sizeof(buf)), buf);
@@ -92,7 +92,7 @@ int main(int argc, char **argv)
}
if (argc > 1) {
- sprintf(name, "/dev/input/event%d", atoi(argv[1]));
+ snprintf(name, sizeof(name), "/dev/input/event%d", atoi(argv[1]));
if ((fd = open(name, O_RDWR, 0)) >= 0) {
printf("%s: open, fd = %d\n", name, fd);
for (i = 0; i < LED_MAX; i++) {
diff --git a/hw/dmx/glxProxy/glxscreens.c b/hw/dmx/glxProxy/glxscreens.c
index 01e041c8f..baa4a65a7 100644
--- a/hw/dmx/glxProxy/glxscreens.c
+++ b/hw/dmx/glxProxy/glxscreens.c
@@ -120,8 +120,9 @@ static void CalcServerVersionAndExtensions( void )
__glXVersionMinor = GLX_SERVER_MINOR_VERSION;
}
- sprintf(GLXServerVersion, "%d.%d DMX %d back-end server(s)",
- __glXVersionMajor, __glXVersionMinor, __glXNumActiveScreens );
+ snprintf(GLXServerVersion, sizeof(GLXServerVersion),
+ "%d.%d DMX %d back-end server(s)",
+ __glXVersionMajor, __glXVersionMinor, __glXNumActiveScreens );
/*
* set the ExtensionsString to the minimum extensions string
*/