Page MenuHomeFreeBSD

hwpmc: don't use deprecated copystr(9)
ClosedPublic

Authored by mhorne on May 1 2023, 7:39 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Dec 11, 10:31 PM
Unknown Object (File)
Sat, Dec 7, 10:15 AM
Unknown Object (File)
Thu, Nov 28, 3:21 PM
Unknown Object (File)
Nov 20 2024, 4:09 PM
Unknown Object (File)
Nov 8 2024, 5:22 PM
Unknown Object (File)
Oct 3 2024, 9:31 PM
Unknown Object (File)
Oct 3 2024, 9:26 PM
Unknown Object (File)
Oct 3 2024, 7:28 PM

Details

Summary

It is just wrapper around strlcpy(), but results in more complicated
code. Clean this up to use strlcpy() or snprintf() as appropriate.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 51315
Build 48206: arc lint + arc unit

Event Timeline

mhorne requested review of this revision.May 1 2023, 7:39 PM
jkoshy requested changes to this revision.May 2 2023, 7:42 AM
jkoshy added inline comments.
sys/dev/hwpmc/hwpmc_amd.c
919

How about using sizeof(pi->pm_name) instead of PMC_NAME_MAX?

This would remove the need for the reader to check that the pm_name field is at least PMC_NAME_MAX in size.

Here and below.

This revision now requires changes to proceed.May 2 2023, 7:42 AM
mhorne marked an inline comment as done.

Use sizeof(pi->pm_name).

This revision is now accepted and ready to land.May 2 2023, 5:58 PM
This revision was automatically updated to reflect the committed changes.