fbdev: offb: Simplify offb_init_fb()
Turn a strcpy()+strncat()+'\0' into an equivalent snprintf(). Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Helge Deller <deller@gmx.de>
This commit is contained in:
committed by
Helge Deller
parent
7be6adf113
commit
02d487fa30
@ -423,11 +423,9 @@ static void offb_init_fb(struct platform_device *parent, const char *name,
|
|||||||
fix = &info->fix;
|
fix = &info->fix;
|
||||||
var = &info->var;
|
var = &info->var;
|
||||||
|
|
||||||
if (name) {
|
if (name)
|
||||||
strcpy(fix->id, "OFfb ");
|
snprintf(fix->id, sizeof(fix->id), "OFfb %s", name);
|
||||||
strncat(fix->id, name, sizeof(fix->id) - sizeof("OFfb "));
|
else
|
||||||
fix->id[sizeof(fix->id) - 1] = '\0';
|
|
||||||
} else
|
|
||||||
snprintf(fix->id, sizeof(fix->id), "OFfb %pOFn", dp);
|
snprintf(fix->id, sizeof(fix->id), "OFfb %pOFn", dp);
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user