Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Aug 2025 06:02:24 GMT
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: b91babab9596 - stable/14 - mmc_xpt: use strlcpy instead of strncpy
Message-ID:  <202508060602.57662O27076633@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by avg:

URL: https://cgit.FreeBSD.org/src/commit/?id=b91babab95965209bae8388c1004d8c42fdc0547

commit b91babab95965209bae8388c1004d8c42fdc0547
Author:     Andriy Gapon <avg@FreeBSD.org>
AuthorDate: 2025-06-23 21:31:04 +0000
Commit:     Andriy Gapon <avg@FreeBSD.org>
CommitDate: 2025-08-06 05:56:44 +0000

    mmc_xpt: use strlcpy instead of strncpy
    
    A better practice in general.
    
    (cherry picked from commit ad8d33679999c0e7f6fd2b77d2e414102bd365ec)
---
 sys/cam/mmc/mmc_xpt.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sys/cam/mmc/mmc_xpt.c b/sys/cam/mmc/mmc_xpt.c
index 41b3f5146530..7280890348c1 100644
--- a/sys/cam/mmc/mmc_xpt.c
+++ b/sys/cam/mmc/mmc_xpt.c
@@ -1214,9 +1214,9 @@ mmc_path_inq(struct ccb_pathinq *cpi, const char *hba,
 	cpi->max_lun = 0;
 	cpi->initiator_id = 1;
 	cpi->maxio = maxio;
-	strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
-	strncpy(cpi->hba_vid, hba, HBA_IDLEN);
-	strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
+	strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
+	strlcpy(cpi->hba_vid, hba, HBA_IDLEN);
+	strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
 	cpi->unit_number = cam_sim_unit(sim);
 	cpi->bus_id = cam_sim_bus(sim);
 	cpi->protocol = PROTO_MMCSD;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202508060602.57662O27076633>