A
Aleksandar Milivojevic
I had to write implementation of strlcat() (some source from Microsoft
I got was using it, and strlcat/strlcpy doesn't exist in my libc).
Two quick questions.
If NULL is not encountered in first _size_ bytes of _dst_, should
strlcat() return _size_ + strlen(_src_), or should it return _size_?
Some manual pages I found were not exactly clear about this.
If it should return just the _size_ as passed as third parameter to
strlcat(), what it should return in special case where _size_ is zero?
strlen(src)? Or zero (since terminating NULL was obviously never
traversed)?
I got was using it, and strlcat/strlcpy doesn't exist in my libc).
Two quick questions.
If NULL is not encountered in first _size_ bytes of _dst_, should
strlcat() return _size_ + strlen(_src_), or should it return _size_?
Some manual pages I found were not exactly clear about this.
If it should return just the _size_ as passed as third parameter to
strlcat(), what it should return in special case where _size_ is zero?
strlen(src)? Or zero (since terminating NULL was obviously never
traversed)?