J.A.Serralheiro writes: > right. It should be strlen(buff ) Just a word of warning: strlen can be a problem if the buffer is not filled with stuff that you can validate--ie: if buff isn't a NULL terminated string, then it looks for the NULL byte off the end of the buffer, which can lead to much strangeness, and probably core dumps, later on. So even if you get a length using strlen, you should make sure it doesn't go beyond the end of the buffer.
Andrew.