From 9207bae33b6ae5427331e3c5f4b83a2438b6fd51 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Mon, 27 May 2024 21:31:54 +0200 Subject: [PATCH] device_id: use faster dm_strncpy --- lib/device/device_id.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/device/device_id.c b/lib/device/device_id.c index 49922e80f..d1b3d44ac 100644 --- a/lib/device/device_id.c +++ b/lib/device/device_id.c @@ -2513,7 +2513,7 @@ static int _match_du_to_dev(struct cmd_context *cmd, struct dev_use *du, struct * string is modified to t10.123_456 so that it will match the value * returned from device_id_system_read(). */ - strncpy(du_idname, du->idname, PATH_MAX-1); + dm_strncpy(du_idname, du->idname, sizeof(du_idname)); if (((du->idtype == DEV_ID_TYPE_SYS_WWID) || (du->idtype == DEV_ID_TYPE_SYS_SERIAL)) && strchr(du_idname, '_')) { _remove_leading_underscores(du_idname, sizeof(du_idname));