From 5ac29e62be2a581ec77953eca64d85ddeef488f0 Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Wed, 6 Dec 2006 20:37:06 -0800 Subject: [PATCH] drivers/cdrom/*: trivial vsnprintf() conversion Fixing sbpcd.c baroque error printing in process. Signed-off-by: Alexey Dobriyan Cc: Jens Axboe Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/cdrom/sbpcd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/cdrom/sbpcd.c') diff --git a/drivers/cdrom/sbpcd.c b/drivers/cdrom/sbpcd.c index ba50e5a712f..a1283b1ef98 100644 --- a/drivers/cdrom/sbpcd.c +++ b/drivers/cdrom/sbpcd.c @@ -770,11 +770,10 @@ static void msg(int level, const char *fmt, ...) msgnum++; if (msgnum>99) msgnum=0; - sprintf(buf, MSG_LEVEL "%s-%d [%02d]: ", major_name, current_drive - D_S, msgnum); va_start(args, fmt); - vsprintf(&buf[18], fmt, args); + vsnprintf(buf, sizeof(buf), fmt, args); va_end(args); - printk(buf); + printk(MSG_LEVEL "%s-%d [%02d]: %s", major_name, current_drive - D_S, msgnum, buf); #if KLOGD_PAUSE sbp_sleep(KLOGD_PAUSE); /* else messages get lost */ #endif /* KLOGD_PAUSE */ -- cgit v1.2.3-70-g09d2