Adds an implementation for stpcpy and stpncpy, which are posix extension
functions.
Details
- Reviewers
sivachandra lntue - Commits
- rG9b6f8b985c6a: [libc] add stpcpy and stpncpy
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
libc/src/string/stpcpy.cpp | ||
---|---|---|
32 | Not sure if this is a valid argument for mempcpy. As in, we might want mempcpy to be instrumented really. | |
libc/src/string/stpncpy.cpp | ||
19 | Nit: Instead of initializing to 0 here, do it in the for statement ... | |
22 | ... like this: for (i = 0; ...) | |
25 | Nit: This can be size_t end = i; | |
27 | Can this for loop be replaced with a call to bzero? |
respond to comments
libc/src/string/stpcpy.cpp | ||
---|---|---|
32 | I was figuring that since mempcpy is effectively just a call to memcpy it should be treated the same, but I have no strong opinion one way or another. |
libc/src/string/stpncpy.cpp | ||
---|---|---|
25 | Do you still need both i and end? |
Not sure if this is a valid argument for mempcpy. As in, we might want mempcpy to be instrumented really.