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)
Fri, Sep 27, 9:55 AM
Unknown Object (File)
Tue, Sep 17, 11:48 AM
Unknown Object (File)
Mon, Sep 16, 9:23 PM
Unknown Object (File)
Thu, Sep 5, 12:28 AM
Unknown Object (File)
Aug 29 2024, 4:56 PM
Unknown Object (File)
Aug 9 2024, 4:36 AM
Unknown Object (File)
Aug 9 2024, 4:36 AM
Unknown Object (File)
Aug 9 2024, 4:36 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 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.