Commit 02d487fa authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Helge Deller
Browse files

fbdev: offb: Simplify offb_init_fb()



Turn a strcpy()+strncat()+'\0' into an equivalent snprintf().

Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
parent 7be6adf1
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -423,11 +423,9 @@ static void offb_init_fb(struct platform_device *parent, const char *name,
	fix = &info->fix;
	var = &info->var;

	if (name) {
		strcpy(fix->id, "OFfb ");
		strncat(fix->id, name, sizeof(fix->id) - sizeof("OFfb "));
		fix->id[sizeof(fix->id) - 1] = '\0';
	} else
	if (name)
		snprintf(fix->id, sizeof(fix->id), "OFfb %s", name);
	else
		snprintf(fix->id, sizeof(fix->id), "OFfb %pOFn", dp);