# \[PATCH 10/35\] fbdev: stifb: Use safer strscpy() instead of strcpy()

- From: Ai Chao \<hidden\>
- Date: 2026-04-25 07:00:11 
- List: linux-fbdev
- Page: https://ratatoskr.run/linux-fbdev/2026/04/3528969
- Thread: https://ratatoskr.run/linux-fbdev/2026/04/3528984/t.md

```text
Use a safer function strscpy() instead of strcpy() for copying to arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Ai Chao <redacted>
---
 drivers/video/fbdev/stifb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/stifb.c b/drivers/video/fbdev/stifb.c
index 8e5bac27542d..578770bdee02 100644
--- a/drivers/video/fbdev/stifb.c
+++ b/drivers/video/fbdev/stifb.c
@@ -1357,7 +1357,7 @@ static int __init stifb_init_fb(struct sti_struct *sti, int bpp_pref)
 	var->yres = var->yres_virtual = yres;
 	var->bits_per_pixel = bpp;
 
-	strcpy(fix->id, "stifb");
+	strscpy(fix->id, "stifb");
 	info->fbops = &stifb_ops;
 	info->screen_base = ioremap(REGION_BASE(fb,1), fix->smem_len);
 	if (!info->screen_base) {
-- 
2.34.1

```
