https://gitlab.synchro.net/main/sbbs/-/commit/4558358c29093eb89495d07d
Modified Files:
src/doors/clans-src/src/scores.c src/doors/clans-src/src/tests/test_scores.c
Log Message:
Fix sizeof(pointer) bugs in scores.c color string functions
GetColourString and PipeToAnsi were passing sizeof(char*) to strlcpy/strlcat, which yields 8 bytes on 64-bit platforms instead of the actual buffer size. This truncated ANSI escape sequences to 7 bytes maximum.
Changes:
- Add size_t n parameter to GetColourString signature; replace all
sizeof(szColourString) calls with n
- Add size_t n parameter to PipeToAnsi signature; use correct buffer sizes
for GetColourString calls and strlcat operations
- Update DisplayScores to pass sizeof(AnsiSymbol) to PipeToAnsi
- Update test_scores.c: add sizeof parameters to all function calls,
remove known-bug comment, strengthen test_pipe_text_after_code assertion
All 588 unit and integration tests pass, including 9 test_scores tests.
Co-Authored-By: Claude Haiku 4.5 <
noreply@anthropic.com>
---
■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net