# \[PATCH 08/35\] fbdev: xen-fbfront: Use safer strscpy() instead of strcpy()

- From: Ai Chao \<hidden\>
- Date: 2026-04-25 07:00:05 
- List: linux-fbdev
- Page: https://ratatoskr.run/linux-fbdev/2026/04/3528968
- 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/xen-fbfront.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/xen-fbfront.c b/drivers/video/fbdev/xen-fbfront.c
index 4385976277ac..1cc234751be5 100644
--- a/drivers/video/fbdev/xen-fbfront.c
+++ b/drivers/video/fbdev/xen-fbfront.c
@@ -429,7 +429,7 @@ static int xenfb_probe(struct xenbus_device *dev,
 	fb_info->fix.line_length = fb_info->var.xres * XENFB_DEPTH / 8;
 	fb_info->fix.smem_start = 0;
 	fb_info->fix.smem_len = fb_size;
-	strcpy(fb_info->fix.id, "xen");
+	strscpy(fb_info->fix.id, "xen");
 	fb_info->fix.type = FB_TYPE_PACKED_PIXELS;
 	fb_info->fix.accel = FB_ACCEL_NONE;
 
-- 
2.34.1

```
