Page MenuHomeFreeBSD

Remove unportable calls to basename().
ClosedPublic

Authored by ed on Apr 25 2016, 8:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 19, 6:45 PM
Unknown Object (File)
Jan 27 2024, 12:23 AM
Unknown Object (File)
Jan 9 2024, 7:16 AM
Unknown Object (File)
Dec 22 2023, 9:40 PM
Unknown Object (File)
Dec 5 2023, 5:27 AM
Unknown Object (File)
Nov 13 2023, 10:37 AM
Unknown Object (File)
Oct 24 2023, 8:46 PM
Unknown Object (File)
Oct 10 2023, 9:59 AM
Subscribers

Details

Summary

The POSIX version of basename() doesn't use a 'const char *' argument;
the function may overwrite its input buffer. Instead of copying the
input string, let's just simplify this code by using our getprogname()
function that already returns the name of the application in the right
format.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ed retitled this revision from to Remove unportable calls to basename()..
ed updated this object.
ed edited the test plan for this revision. (Show Details)
ed added reviewers: jilles, allanjude.
allanjude edited edge metadata.

Reducing the number of calls is also nice

This revision is now accepted and ready to land.Apr 25 2016, 8:27 PM
This revision was automatically updated to reflect the committed changes.