summaryrefslogtreecommitdiff
path: root/drivers/base
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-02-18 04:49:34 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-02-18 04:49:34 -0800
commit01d1a791d1a13df17b649459eec6830f226c7163 (patch)
tree851c48c86a683ab46e89b9fff7b4fc9eba36cde1 /drivers/base
parent53b15b863e95defe1487a67e6ca5502a0b4d3e5f (diff)
[PATCH] snprintf fixes
From: Juergen Quade <quade@hsnr.de> Lots of places in the kernel are using [v]snprintf wrongly: they assume it returns the number of characters copied. It doesn't. It returns the number of characters which _would_ have been copied had the buffer not been filled up. So create new functions vscnprintf() and scnprintf() which have the expected (sane) semaptics, and migrate callers over to using them.
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/dmapool.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/base/dmapool.c b/drivers/base/dmapool.c
index f93d552b7d99..bbbf06643be8 100644
--- a/drivers/base/dmapool.c
+++ b/drivers/base/dmapool.c
@@ -52,7 +52,7 @@ show_pools (struct device *dev, char *buf)
next = buf;
size = PAGE_SIZE;
- temp = snprintf (next, size, "poolinfo - 0.1\n");
+ temp = scnprintf(next, size, "poolinfo - 0.1\n");
size -= temp;
next += temp;
@@ -67,7 +67,7 @@ show_pools (struct device *dev, char *buf)
}
/* per-pool info, no real statistics yet */
- temp = snprintf (next, size, "%-16s %4u %4Zu %4Zu %2u\n",
+ temp = scnprintf(next, size, "%-16s %4u %4Zu %4Zu %2u\n",
pool->name,
blocks, pages * pool->blocks_per_page,
pool->size, pages);