summaryrefslogtreecommitdiffstats
path: root/drivers/cdrom
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2006-12-07 05:37:06 +0100
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-07 17:39:35 +0100
commit5ac29e62be2a581ec77953eca64d85ddeef488f0 (patch)
tree94f7c65ce77f5a0dc6703707fd23283793610028 /drivers/cdrom
parent[PATCH] hpfs: fix printk format warnings (diff)
downloadlinux-5ac29e62be2a581ec77953eca64d85ddeef488f0.tar.xz
linux-5ac29e62be2a581ec77953eca64d85ddeef488f0.zip
[PATCH] drivers/cdrom/*: trivial vsnprintf() conversion
Fixing sbpcd.c baroque error printing in process. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Cc: Jens Axboe <axboe@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/cdrom')
-rw-r--r--drivers/cdrom/optcd.c2
-rw-r--r--drivers/cdrom/sbpcd.c5
2 files changed, 3 insertions, 4 deletions
diff --git a/drivers/cdrom/optcd.c b/drivers/cdrom/optcd.c
index 25032d7edc55..3541690a77d4 100644
--- a/drivers/cdrom/optcd.c
+++ b/drivers/cdrom/optcd.c
@@ -101,7 +101,7 @@ static void debug(int debug_this, const char* fmt, ...)
return;
va_start(args, fmt);
- vsprintf(s, fmt, args);
+ vsnprintf(s, sizeof(s), fmt, args);
printk(KERN_DEBUG "optcd: %s\n", s);
va_end(args);
}
diff --git a/drivers/cdrom/sbpcd.c b/drivers/cdrom/sbpcd.c
index ba50e5a712f2..a1283b1ef989 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 */