Depending on what exactly you are trying to learn from this, I would recommend looking at the source for musl like https://git.musl-libc.org/cgit/musl/tree/src/string and trying to understand why it looks so much more complicated than the simple implementation.
No comments yet.