How do you know that the buffer only contains data upto the first nul? How did you view this buffer? If your data contains embedded nul you can't use any of the string functions. You will need to...