From a2976b9a11b8b9424a073305a1e0ff19a338009a Mon Sep 17 00:00:00 2001 From: andyuhnak Date: Tue, 3 Nov 2015 10:16:18 +0100 Subject: Fix non-ASCII end-of-line character check --- src/cmark_ctype.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/cmark_ctype.c') 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; } -- cgit v1.2.3