summaryrefslogtreecommitdiff
path: root/hw/xfree86/fbdevhw/fbdevhw.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2011-10-29 11:08:17 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2011-11-23 12:15:06 -0800
commit05d8a7f7a785eff3292f0f0537bb3902930f1b5c (patch)
tree43dc322a988c1fab65622c2aea31c2b818ce20c8 /hw/xfree86/fbdevhw/fbdevhw.c
parentb967bf2af264726042e2f6ffb9ca7d234f34b56b (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/xfree86/fbdevhw/fbdevhw.c')
-rw-r--r--hw/xfree86/fbdevhw/fbdevhw.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/xfree86/fbdevhw/fbdevhw.c b/hw/xfree86/fbdevhw/fbdevhw.c
index 30a2a9133..d7b4d3c20 100644
--- a/hw/xfree86/fbdevhw/fbdevhw.c
+++ b/hw/xfree86/fbdevhw/fbdevhw.c
@@ -265,20 +265,20 @@ fbdev_open_pci(struct pci_device * pPci, char **namep)
int fd, i;
for (i = 0; i < 8; i++) {
- sprintf(filename,
+ snprintf(filename, sizeof(filename),
"/sys/bus/pci/devices/%04x:%02x:%02x.%d/graphics/fb%d",
pPci->domain, pPci->bus, pPci->dev, pPci->func, i);
fd = open(filename, O_RDONLY, 0);
if (fd < 0) {
- sprintf(filename,
+ snprintf(filename, sizeof(filename),
"/sys/bus/pci/devices/%04x:%02x:%02x.%d/graphics:fb%d",
pPci->domain, pPci->bus, pPci->dev, pPci->func, i);
fd = open(filename, O_RDONLY, 0);
}
if (fd >= 0) {
close(fd);
- sprintf(filename, "/dev/fb%d", i);
+ snprintf(filename, sizeof(filename), "/dev/fb%d", i);
fd = open(filename, O_RDWR, 0);
if (fd != -1) {