pcmcia: Use scnprintf() for avoiding potential buffer overflow
[linux-2.6-microblaze.git] / drivers / pcmcia / yenta_socket.c
index 49b1c6a..bf6529b 100644 (file)
@@ -180,12 +180,12 @@ static ssize_t show_yenta_registers(struct device *yentadev, struct device_attri
        for (i = 0; i < 0x24; i += 4) {
                unsigned val;
                if (!(i & 15))
-                       offset += snprintf(buf + offset, PAGE_SIZE - offset, "\n%02x:", i);
+                       offset += scnprintf(buf + offset, PAGE_SIZE - offset, "\n%02x:", i);
                val = cb_readl(socket, i);
-               offset += snprintf(buf + offset, PAGE_SIZE - offset, " %08x", val);
+               offset += scnprintf(buf + offset, PAGE_SIZE - offset, " %08x", val);
        }
 
-       offset += snprintf(buf + offset, PAGE_SIZE - offset, "\n\nExCA registers:");
+       offset += scnprintf(buf + offset, PAGE_SIZE - offset, "\n\nExCA registers:");
        for (i = 0; i < 0x45; i++) {
                unsigned char val;
                if (!(i & 7)) {
@@ -193,10 +193,10 @@ static ssize_t show_yenta_registers(struct device *yentadev, struct device_attri
                                memcpy(buf + offset, " -", 2);
                                offset += 2;
                        } else
-                               offset += snprintf(buf + offset, PAGE_SIZE - offset, "\n%02x:", i);
+                               offset += scnprintf(buf + offset, PAGE_SIZE - offset, "\n%02x:", i);
                }
                val = exca_readb(socket, i);
-               offset += snprintf(buf + offset, PAGE_SIZE - offset, " %02x", val);
+               offset += scnprintf(buf + offset, PAGE_SIZE - offset, " %02x", val);
        }
        buf[offset++] = '\n';
        return offset;