Commit 6b90032c authored by Xu Panda's avatar Xu Panda Committed by Helge Deller
Browse files

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: default avatarXu Panda <xu.panda@zte.com.cn>
Signed-off-by: default avatarYang Yang <yang.yang29@zte.com>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
parent 8d8cf163
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -3192,8 +3192,7 @@ static void aty_init_lcd(struct atyfb_par *par, u32 bios_base)
		 * which we print to the screen.
		 */
		id = *(u8 *)par->lcd_table;
		strncpy(model, (char *)par->lcd_table+1, 24);
		model[23] = 0;
		strscpy(model, (char *)par->lcd_table+1, sizeof(model));

		width = par->lcd_width = *(u16 *)(par->lcd_table+25);
		height = par->lcd_height = *(u16 *)(par->lcd_table+27);