]> diplodocus.org Git - nmh/commitdiff
On platforms with no MIMETYPEPROC, declare the content to be
authorDavid Levine <levinedl@acm.org>
Thu, 22 May 2014 01:50:22 +0000 (20:50 -0500)
committerDavid Levine <levinedl@acm.org>
Thu, 22 May 2014 01:50:22 +0000 (20:50 -0500)
binary if it contains any NUL characters.

sbr/mime_type.c

index be7910967c16ebb406323d0aa9a3ef4e07c46a3e..673642d5b956bc9fe68effef9de0a154b9774feb 100644 (file)
@@ -91,7 +91,7 @@ mime_type(const char *file_name) {
            }
 
            while ((c = getc(fp)) != EOF) {
-               if (! isascii(c)) {
+               if (! isascii(c)  ||  c == 0) {
                    binary = 1;
                    break;
                }