This adds strncat to llvm libc. In addition, an error was found with
strcat and that was fixed.
Details
- Reviewers
lntue - Commits
- rG9e9803bf8250: [libc] Add strncat and fix strcat
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
libc/src/string/strncat.cpp | ||
---|---|---|
23 | I think you should use copyAmount here instead of count, since for strncpy it is specifically said that when srcLength < count, extra '\0' 's will be appended upto count. On the other hand, strncat is only specified to be null-terminated. | |
libc/test/src/string/strncat_test.cpp | ||
61 | Nit: Also add tests where count = srcLength + 1 and count > srcLength + 1. |
libc/src/string/strcat.cpp | ||
---|---|---|
22 | Its not clear to me as to what this change has done that something got "fixed". A corresponding test would have helped me see it may be. |
Its not clear to me as to what this change has done that something got "fixed". A corresponding test would have helped me see it may be.