提交 5ac29e62 编写于 作者: A Alexey Dobriyan 提交者: Linus Torvalds

[PATCH] drivers/cdrom/*: trivial vsnprintf() conversion

Fixing sbpcd.c baroque error printing in process.
Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
Cc: Jens Axboe <axboe@suse.de>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 18debbbc
......@@ -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);
}
......
......@@ -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 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册