]> git.ipfire.org Git - thirdparty/systemd.git/commit
hexdecoct: several cleanups for base64_append()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 6 Dec 2022 21:49:17 +0000 (06:49 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 8 Dec 2022 19:53:50 +0000 (04:53 +0900)
commitc21b316964357f40b8785a8869cbb280e59d3b79
tree00cd743aed9fd288b75f3cd68912ff70eb3ca31d
parent1feb9743d05eadb373caa9aba591871a7d05a278
hexdecoct: several cleanups for base64_append()

- add missing assertions,
- use size_t for buffser size or memory index,
- handle empty input more gracefully,
- return the length or the result string,
- fix off-by-one issue when the prefix is already long enough.
src/basic/hexdecoct.c
src/basic/hexdecoct.h