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

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
...@@ -423,11 +423,9 @@ static void offb_init_fb(struct platform_device *parent, const char *name, ...@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment