Skip to contentSkip to conversation

platform/surface: Replace deprecated strcpy + strcat in blogic_rdconfig

PATCH RESEND Superseded Thorsten Blum 1 participant 1 message Jan 27

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 platform/surface: Replace deprecated strcpy + strcat in blogic_rdconfig

strcpy() is deprecated [1] and using strcat() is discouraged. Replace them with scnprintf(). No functional changes.

---
 drivers/scsi/BusLogic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/BusLogic.c +2 -2
index 865fcbac8fa1..82e436a8f012 100644
@@ -1631,8 +1631,8 @@ static bool __init blogic_rdconfig(struct blogic_adapter *adapter)
 	/*
 	   Initialize the Host Adapter Full Model Name from the Model Name.
 	 */
-	strcpy(adapter->full_model, "BusLogic ");
-	strcat(adapter->full_model, adapter->model);
+	scnprintf(adapter->full_model, sizeof(adapter->full_model),
+		  "BusLogic %s", adapter->model);
 	/*
 	   Select an appropriate value for the Tagged Queue Depth either from a
 	   BusLogic Driver Options specification, or based on whether this Host
Signature · 2 lines
Thorsten Blum <[email protected]>
GPG: 1D60 735E 8AEF 3BE4 73B6  9D84 7336 78FD 8DFE EAD4