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)
Mon, Jan 20, 6:53 PM
Unknown Object (File)
Sat, Jan 18, 7:40 AM
Unknown Object (File)
Wed, Jan 15, 12:34 PM
Unknown Object (File)
Tue, Jan 14, 8:19 AM
Unknown Object (File)
Tue, Jan 14, 7:53 AM
Unknown Object (File)
Fri, Jan 10, 10:40 PM
Unknown Object (File)
Fri, Jan 10, 10:13 PM
Unknown Object (File)
Fri, Jan 10, 6:52 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 51285
Build 48176: 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.