summaryrefslogtreecommitdiff
path: root/scripts/objdiff
diff options
context:
space:
mode:
authorIan Bridges <icb@fastmail.org>2026-07-29 09:46:14 -0500
committerMartin K. Petersen (Oracle) <mkp@kernel.org>2026-08-13 22:15:22 -0400
commit07f46a9f8964b91d56951ef7f74c551af0eddeac (patch)
tree023f0e02f20e072c09dd9e685119328357014ea3 /scripts/objdiff
parent5a03dbfd670092a6960de433005aae1734c18f1f (diff)
downloadlinux-next-07f46a9f8964b91d56951ef7f74c551af0eddeac.tar.gz
linux-next-07f46a9f8964b91d56951ef7f74c551af0eddeac.zip
scsi: lpfc: Replace strlcat() with scnprintf() in lpfc_vport_symbolic_node_name()
In preparation for removing the strlcat() API[1], replace its uses in lpfc_vport_symbolic_node_name(). The function builds five unconditional fragments, so one scnprintf() call composes the whole string. The intermediate tmp buffer and the per fragment overflow checks become unnecessary. scnprintf() truncates at the buffer size and returns the number of bytes it wrote, which equals the length that the removed strnlen() call computed. The old code capped every fragment at MAXHOSTNAMELEN bytes before appending it, independently of the room left in the destination. The replacement formats each fragment directly into the destination, so a fragment longer than MAXHOSTNAMELEN is no longer truncated when the destination has room for it. Link: https://github.com/KSPP/linux/issues/370 [1] Signed-off-by: Ian Bridges <icb@fastmail.org> Link: https://patch.msgid.link/20260729144617.1388646-3-icb@fastmail.org Reviewed-by: Nigel Kirkland <nigel.kirkland@broadcom.com> Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Diffstat (limited to 'scripts/objdiff')
0 files changed, 0 insertions, 0 deletions