mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-15 06:55:13 +08:00
78482af095
This code has two bugs:
1) "cnt" is 255 but the size of the buffer is 256 so the last byte is
not used.
2) If we try to print more than 255 characters then "cnt" will be
negative and that will trigger a WARN() in snprintf(). The fix for
this is to use scnprintf() instead of snprintf().
We can re-write this code to be cleaner:
1) Rename "offset" to "off" because that's shorter.
2) Get rid of the "cnt" variable and just use "size - off" directly.
3) Get rid of the "read" variable and just increment "off" directly.
Fixes:
|
||
---|---|---|
.. | ||
bitblit.c | ||
cfbcopyarea.c | ||
cfbfillrect.c | ||
cfbimgblt.c | ||
fb_cmdline.c | ||
fb_ddc.c | ||
fb_defio.c | ||
fb_draw.h | ||
fb_notify.c | ||
fb_sys_fops.c | ||
fbcmap.c | ||
fbcon_ccw.c | ||
fbcon_cw.c | ||
fbcon_rotate.c | ||
fbcon_rotate.h | ||
fbcon_ud.c | ||
fbcon.c | ||
fbcon.h | ||
fbcvt.c | ||
fbmem.c | ||
fbmon.c | ||
fbsysfs.c | ||
Makefile | ||
modedb.c | ||
softcursor.c | ||
svgalib.c | ||
syscopyarea.c | ||
sysfillrect.c | ||
sysimgblt.c | ||
tileblit.c |