]> diplodocus.org Git - nmh/commitdiff
Add FIXME raising if iscntrl(3) test should be based on isprint(3)
authorRalph Corderoy <ralph@inputplus.co.uk>
Fri, 21 Oct 2016 20:18:38 +0000 (21:18 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Fri, 21 Oct 2016 20:18:38 +0000 (21:18 +0100)
!iscntrl blocks characters that could be isspace or isblank whereas
isprint would let them through unharmed.

uip/mhparse.c

index 4cff8b9..0c2c17c 100644 (file)
@@ -4248,6 +4248,10 @@ noiconv:
     q = buffer;
     bufsize = sizeof(buffer);
     for (p = pm->pm_value; *p != '\0' && bufsize > 1; p++, q++, bufsize--) {
+        /* FIXME: !iscntrl should perhaps be isprint as that allows all
+         * classes bar cntrl, whereas the cntrl class can include those
+         * in space and blank.
+         * http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap07.html */
        if (isascii((unsigned char) *p) && !iscntrl((unsigned char) *p))
            *q = *p;
        else