diff options
| author | Jakob Kaivo <jkk@ung.org> | 2023-11-14 16:31:31 -0500 |
|---|---|---|
| committer | Jakob Kaivo <jkk@ung.org> | 2023-11-14 16:31:31 -0500 |
| commit | 0030c5ea720f492fcaed2cd5ebb52f7ad54170fd (patch) | |
| tree | 2c507618e3c22ce1062d823200d0811375797fcd /src/ctype | |
| parent | 88aa612a4e75833368f6c4552d95d1d5c1232555 (diff) | |
return 0 if c is EOF
Diffstat (limited to 'src/ctype')
| -rw-r--r-- | src/ctype/isblank.c | 2 | ||||
| -rw-r--r-- | src/ctype/iscntrl.c | 2 | ||||
| -rw-r--r-- | src/ctype/isgraph.c | 2 | ||||
| -rw-r--r-- | src/ctype/islower.c | 2 | ||||
| -rw-r--r-- | src/ctype/isprint.c | 2 | ||||
| -rw-r--r-- | src/ctype/ispunct.c | 2 | ||||
| -rw-r--r-- | src/ctype/isspace.c | 2 | ||||
| -rw-r--r-- | src/ctype/isxdigit.c | 2 |
8 files changed, 8 insertions, 8 deletions
diff --git a/src/ctype/isblank.c b/src/ctype/isblank.c index 5b5ad8b1..54b5d239 100644 --- a/src/ctype/isblank.c +++ b/src/ctype/isblank.c @@ -12,7 +12,7 @@ int isblank(int c) ASSERT_REPRESENTABLE(c, 0, UCHAR_MAX, "unsigned char", EOF); - return map[c] & CT_BLANK; + return c == EOF ? 0 : map[c] & CT_BLANK; } /*** diff --git a/src/ctype/iscntrl.c b/src/ctype/iscntrl.c index 4c733b2c..83c52e1c 100644 --- a/src/ctype/iscntrl.c +++ b/src/ctype/iscntrl.c @@ -10,7 +10,7 @@ int iscntrl(int c) ASSERT_REPRESENTABLE(c, 0, UCHAR_MAX, unsigned char, EOF); - return map[c] & CT_CNTRL; + return c == EOF ? 0 : map[c] & CT_CNTRL; } /*** diff --git a/src/ctype/isgraph.c b/src/ctype/isgraph.c index 49de9c1f..3a8f2871 100644 --- a/src/ctype/isgraph.c +++ b/src/ctype/isgraph.c @@ -10,7 +10,7 @@ int isgraph(int c) ASSERT_REPRESENTABLE(c, 0, UCHAR_MAX, unsigned char, EOF); - return map[c] & CT_GRAPH; + return c == EOF ? 0 : map[c] & CT_GRAPH; } /*** diff --git a/src/ctype/islower.c b/src/ctype/islower.c index 259d1149..0a928a33 100644 --- a/src/ctype/islower.c +++ b/src/ctype/islower.c @@ -10,7 +10,7 @@ int islower(int c) ASSERT_REPRESENTABLE(c, 0, UCHAR_MAX, unsigned char, EOF); - return map[c] & CT_LOWER; + return c == EOF ? 0 : map[c] & CT_LOWER; } /*** diff --git a/src/ctype/isprint.c b/src/ctype/isprint.c index e7843442..b0aa2121 100644 --- a/src/ctype/isprint.c +++ b/src/ctype/isprint.c @@ -10,7 +10,7 @@ int isprint(int c) ASSERT_REPRESENTABLE(c, 0, UCHAR_MAX, unsigned char, EOF); - return map[c] & CT_PRINT; + return c == EOF ? 0 : map[c] & CT_PRINT; } /*** diff --git a/src/ctype/ispunct.c b/src/ctype/ispunct.c index 7dcf3c99..f1ddf41c 100644 --- a/src/ctype/ispunct.c +++ b/src/ctype/ispunct.c @@ -10,7 +10,7 @@ int ispunct(int c) ASSERT_REPRESENTABLE(c, 0, UCHAR_MAX, unsigned char, EOF); - return map[c] & CT_PUNCT; + return c == EOF ? 0 : map[c] & CT_PUNCT; } /*** diff --git a/src/ctype/isspace.c b/src/ctype/isspace.c index 8c0a9c18..ca39d051 100644 --- a/src/ctype/isspace.c +++ b/src/ctype/isspace.c @@ -10,7 +10,7 @@ int isspace(int c) ASSERT_REPRESENTABLE(c, 0, UCHAR_MAX, unsigned char, EOF); - return map[c] & CT_SPACE; + return c == EOF ? 0 : map[c] & CT_SPACE; } /*** diff --git a/src/ctype/isxdigit.c b/src/ctype/isxdigit.c index a534d2f0..6c44a37e 100644 --- a/src/ctype/isxdigit.c +++ b/src/ctype/isxdigit.c @@ -10,7 +10,7 @@ int isxdigit(int c) ASSERT_REPRESENTABLE(c, 0, UCHAR_MAX, unsigned char, EOF); - return map[c] & CT_XDIGIT; + return c == EOF ? 0 : map[c] & CT_XDIGIT; } /*** |
