Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The zero byte rule has nothing to do with strcmp(). Text files never contain 0-bytes, so having one is a strong sign the file is binary. Many detectors check for this.


> Text files never contain 0-bytes

that might be true for ASCII but there are other text encodings out there

And again, if a detector doesn't check for the more specific matches first, before falling back to "ah, that seems to be text", then the detector is broken




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: