fbdev: atyfb: use strscpy() to instead of strncpy()
The implementation of strscpy() is more robust and safer. That's now the recommended way to copy NUL-terminated strings. Signed-off-by: Xu Panda <xu.panda@zte.com.cn> Signed-off-by: Yang Yang <yang.yang29@zte.com> Signed-off-by: Helge Deller <deller@gmx.de>
This commit is contained in:
parent
8d8cf163c8
commit
6b90032c73
|
@ -3192,8 +3192,7 @@ static void aty_init_lcd(struct atyfb_par *par, u32 bios_base)
|
||||||
* which we print to the screen.
|
* which we print to the screen.
|
||||||
*/
|
*/
|
||||||
id = *(u8 *)par->lcd_table;
|
id = *(u8 *)par->lcd_table;
|
||||||
strncpy(model, (char *)par->lcd_table+1, 24);
|
strscpy(model, (char *)par->lcd_table+1, sizeof(model));
|
||||||
model[23] = 0;
|
|
||||||
|
|
||||||
width = par->lcd_width = *(u16 *)(par->lcd_table+25);
|
width = par->lcd_width = *(u16 *)(par->lcd_table+25);
|
||||||
height = par->lcd_height = *(u16 *)(par->lcd_table+27);
|
height = par->lcd_height = *(u16 *)(par->lcd_table+27);
|
||||||
|
|
Loading…
Reference in New Issue