NetBSD: Fix portability of isspace(3) usage
authorKamil Rytarowski <n54@gmx.com>
Fri, 29 Jan 2016 01:42:53 +0000 (02:42 +0100)
committerKamil Rytarowski <n54@gmx.com>
Fri, 29 Jan 2016 01:42:53 +0000 (02:42 +0100)
commit8b0366fe977b3188019edd5b112489a9d19c025f
tree687262ba4085debad375af4e2bb615948e4c1663
parent02d8c0f28c8008aef40775ed55e123e8280094ef
NetBSD: Fix portability of isspace(3) usage

NAME
     isspace - white-space character test

LIBRARY
     Standard C Library (libc, -lc)

SYNOPSIS
     #include <ctype.h>

     int
     isspace(int c);

STANDARDS
     The isspace() function conforms to ANSI X3.159-1989 (``ANSI C89'').

CAVEATS
     The argument to isspace() must be EOF or representable as an unsigned
     char; otherwise, the behavior is undefined.

-- NetBSD man-page

This behavior is POSIX and Standard C:

The c argument is an int, the value of which the application shall ensure is a
character representable as an unsigned char or equal to the value of the macro
EOF. If the argument has any other value, the behavior is undefined.

-- The Open Group Base Specifications Issue 6
   IEEE Std 1003.1, 2004 Edition

C11 standard:
The header declares several functions useful for classifying and mapping
characters In all cases the argument is an int, the value of which shall be
representable as an unsigned char or shall equal the value of the macro EOF. If
the argument has any other value, the behavior is undefined.

-- 7.4 Character handling <ctype.h> paragraph 1
src/pal/src/safecrt/input.inl