diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-11-03 09:51:22 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-11-03 09:51:22 -0800 |
commit | b5a8a8b324704420d1f622b3d081ad2fb7156bf3 (patch) | |
tree | eb59ca50d26748d2977592d186cb2fb3fdc027fd | |
parent | b95def0719d823eb6bc11780ce8729d89c3ebf69 (diff) | |
parent | a2976b9a11b8b9424a073305a1e0ff19a338009a (diff) |
Merge pull request #93 from Anderas/master
Fix non-ASCII end-of-line character check
-rw-r--r-- | src/cmark_ctype.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/cmark_ctype.c b/src/cmark_ctype.c index 863c35e..c9a9b0e 100644 --- a/src/cmark_ctype.c +++ b/src/cmark_ctype.c @@ -4,7 +4,7 @@ /** 1 = space, 2 = punct, 3 = digit, 4 = alpha, 0 = other */ -static const int8_t cmark_ctype_class[256] = { +static const uint8_t cmark_ctype_class[256] = { /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */ /* 0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, /* 1 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -26,17 +26,17 @@ static const int8_t cmark_ctype_class[256] = { /** * Returns 1 if c is a "whitespace" character as defined by the spec. */ -int cmark_isspace(char c) { return cmark_ctype_class[(int8_t)c] == 1; } +int cmark_isspace(char c) { return cmark_ctype_class[(uint8_t)c] == 1; } /** * Returns 1 if c is an ascii punctuation character. */ -int cmark_ispunct(char c) { return cmark_ctype_class[(int8_t)c] == 2; } +int cmark_ispunct(char c) { return cmark_ctype_class[(uint8_t)c] == 2; } int cmark_isalnum(char c) { - int8_t result; - result = cmark_ctype_class[(int8_t)c]; + uint8_t result; + result = cmark_ctype_class[(uint8_t)c]; return (result == 3 || result == 4); } -int cmark_isdigit(char c) { return cmark_ctype_class[(int8_t)c] == 3; } +int cmark_isdigit(char c) { return cmark_ctype_class[(uint8_t)c] == 3; } |