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)
Thu, Nov 28, 3:21 PM
Unknown Object (File)
Wed, Nov 20, 4:09 PM
Unknown Object (File)
Fri, Nov 8, 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
Unknown Object (File)
Sep 27 2024, 9:55 AM
Unknown Object (File)
Sep 17 2024, 11:48 AM

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 Not Applicable
Unit
Tests Not Applicable

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.