Page MenuHomeFreeBSD

Let l64a() properly null terminate its result.
ClosedPublic

Authored by ed on May 23 2016, 3:05 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 13, 3:04 AM
Unknown Object (File)
Wed, Nov 6, 6:05 PM
Unknown Object (File)
Mon, Oct 28, 10:48 PM
Unknown Object (File)
Mon, Oct 28, 5:26 PM
Unknown Object (File)
Sun, Oct 27, 12:09 AM
Unknown Object (File)
Oct 17 2024, 3:17 AM
Unknown Object (File)
Oct 2 2024, 11:12 AM
Unknown Object (File)
Sep 29 2024, 11:32 PM
Subscribers

Details

Summary

Though the buffer used by l64a() is initialized with null bytes,
repetetive calls may end up having trailing garbage of previous
invocations because we don't end up terminating the string.

Instead of importing NetBSD's fix, use this opportunity to simplify this
function dramatically, for example by just storing the Base64 character
set in a string. There is also no need to do the bitmasking, as we can
just use the proper integer type from <stdint.h>.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 3904
Build 3947: arc lint + arc unit

Event Timeline

ed retitled this revision from to Let l64a() properly null terminate its result..
ed updated this object.
ed added reviewers: trhodes, jilles.

Revert unneccessary local change.

This revision was automatically updated to reflect the committed changes.