[PATCH] snprintf fixes
authorAndrew Morton <akpm@osdl.org>
Wed, 18 Feb 2004 12:49:34 +0000 (04:49 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 18 Feb 2004 12:49:34 +0000 (04:49 -0800)
commit01d1a791d1a13df17b649459eec6830f226c7163
tree851c48c86a683ab46e89b9fff7b4fc9eba36cde1
parent53b15b863e95defe1487a67e6ca5502a0b4d3e5f
[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.
32 files changed:
arch/i386/kernel/edd.c
arch/ppc64/kernel/lparcfg.c
arch/ppc64/kernel/rtas-proc.c
arch/sparc/prom/printf.c
arch/sparc64/prom/printf.c
arch/x86_64/kernel/early_printk.c
drivers/base/dmapool.c
drivers/char/sn_serial.c
drivers/char/viocons.c
drivers/cpufreq/cpufreq.c
drivers/cpufreq/proc_intf.c
drivers/md/dm-stripe.c
drivers/media/video/videocodec.c
drivers/net/wan/comx-hw-munich.c
drivers/parisc/dino.c
drivers/pci/hotplug.c
drivers/s390/char/tape_core.c
drivers/s390/cio/device.c
drivers/scsi/scsi_debug.c
drivers/usb/gadget/goku_udc.c
drivers/usb/gadget/net2280.c
drivers/usb/gadget/pxa2xx_udc.c
drivers/usb/host/ehci-dbg.c
drivers/usb/host/ohci-dbg.c
drivers/usb/misc/speedtch.c
include/linux/kernel.h
kernel/printk.c
lib/bitmap.c
lib/vsprintf.c
net/atm/clip.c
security/selinux/selinuxfs.c
sound/core/info.c