Skip to content

Add unit tests for okj_copy_string with a 1-byte destination buffer#31

Merged
ionux merged 1 commit intomainfrom
claude/add-buffer-edge-case-tests-cr3gU
Mar 11, 2026
Merged

Add unit tests for okj_copy_string with a 1-byte destination buffer#31
ionux merged 1 commit intomainfrom
claude/add-buffer-edge-case-tests-cr3gU

Conversation

@ionux
Copy link
Copy Markdown
Owner

@ionux ionux commented Mar 11, 2026

When buf_size == 1, the copy_len calculation yields 0 so no data bytes are written and buf[0] is set to '\0'. The new
test_copy_string_one_byte_buf test asserts this explicitly, proving the API never overflows the smallest possible destination buffer.

https://claude.ai/code/session_018u4CF9SCi7xsDDHYZjsZfs

When buf_size == 1, the copy_len calculation yields 0 so no data bytes
are written and buf[0] is set to '\0'.  The new
test_copy_string_one_byte_buf test asserts this explicitly, proving the
API never overflows the smallest possible destination buffer.

https://claude.ai/code/session_018u4CF9SCi7xsDDHYZjsZfs
@ionux ionux merged commit cbce67a into main Mar 11, 2026
2 checks passed
@ionux ionux deleted the claude/add-buffer-edge-case-tests-cr3gU branch March 11, 2026 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants