Bruce Korb <[EMAIL PROTECTED]> writes: > If valid data is supposed to be ASCII text, then what meaning > do you give to the NUL byte?
It depends on the application. The NUL character is valid in ASCII. For 'sort', for example, it participates in comparison as the least-possible character. > If a data file has random trash in it I guess one person's trash is another's treasure. I can easily see how NUL bytes might be used by standard utilities, e.g., "sort -t '\0' -k 2". > the correct response is something along the lines of EINVAL > whenever strlen(filedata) != filestat.st_size. The GNU coding standards disagree: they say "Utilities reading files should not drop NUL characters".