Page MenuHomeFreeBSD

MAC/do: parse_rules(): Copy input string on its own
ClosedPublic

Authored by olce on Nov 15 2024, 5:06 PM.
Tags
None
Referenced Files
F108433487: D47591.id146524.diff
Fri, Jan 24, 5:49 PM
F108427720: D47591.id.diff
Fri, Jan 24, 5:07 PM
Unknown Object (File)
Sun, Jan 19, 1:17 PM
Unknown Object (File)
Sun, Jan 5, 8:28 PM
Unknown Object (File)
Sun, Dec 29, 7:32 PM
Unknown Object (File)
Fri, Dec 27, 9:53 AM
Unknown Object (File)
Fri, Dec 27, 8:46 AM
Unknown Object (File)
Dec 9 2024, 12:19 PM

Details

Summary

This revision is part of a series. Click on the Stack tab below to see the context.
This series has also been squeezed into D47633 to provide an overall view.

Commit message:
Since all callers have to do it, save them that burden and do it in
parse_rules() instead.

While here, replace "strlen(x) == 0" with the simpler and more efficient
"x[0] == '\0'".

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

olce requested review of this revision.Nov 15 2024, 5:06 PM

In the proposed commit message, I guess you mean:

While here, replace strlen(x) == 0 with the simpler and more efficient
x[0] == '\0'.

Note 0 and \0. I believe the later is better.

Note 0 and \0. I believe the later is better.

Yes. The initial version probably was using 0 and later I changed the code but forgetting to update the commit message. Will do.

This revision is now accepted and ready to land.Nov 19 2024, 7:47 AM