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)
Wed, Dec 4, 10:24 PM
Unknown Object (File)
Oct 2 2024, 6:51 AM
Unknown Object (File)
Sep 17 2024, 11:01 PM
Unknown Object (File)
Sep 11 2024, 12:38 AM
Unknown Object (File)
Sep 2 2024, 7:53 PM
Unknown Object (File)
Aug 31 2024, 12:48 PM
Unknown Object (File)
Aug 31 2024, 12:40 AM
Unknown Object (File)
Aug 29 2024, 7:14 PM
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.