diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-10-29 11:08:17 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-11-23 12:15:06 -0800 |
commit | 05d8a7f7a785eff3292f0f0537bb3902930f1b5c (patch) | |
tree | 43dc322a988c1fab65622c2aea31c2b818ce20c8 /hw/dmx | |
parent | b967bf2af264726042e2f6ffb9ca7d234f34b56b (diff) |
Convert a bunch of sprintf to snprintf calls
This batch is the straightforward set - others are more complex and
need more analysis to determine right size to pass.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Diffstat (limited to 'hw/dmx')
-rw-r--r-- | hw/dmx/examples/ev.c | 4 | ||||
-rw-r--r-- | hw/dmx/glxProxy/glxscreens.c | 5 |
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 */ |