summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorandyuhnak <andyuhnak@gmail.com>2015-11-03 10:16:18 +0100
committerandyuhnak <andyuhnak@gmail.com>2015-11-03 10:16:18 +0100
commita2976b9a11b8b9424a073305a1e0ff19a338009a (patch)
treeeb59ca50d26748d2977592d186cb2fb3fdc027fd /src
parentb95def0719d823eb6bc11780ce8729d89c3ebf69 (diff)
Fix non-ASCII end-of-line character check
Diffstat (limited to 'src')
-rw-r--r--src/cmark_ctype.c12
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; }