]> granicus.if.org Git - multimarkdown/commitdiff
FIXED: Fix bug in Aho-Corasick implementation
authorFletcher T. Penney <fletcher@fletcherpenney.net>
Tue, 14 Mar 2017 18:56:44 +0000 (14:56 -0400)
committerFletcher T. Penney <fletcher@fletcherpenney.net>
Tue, 14 Mar 2017 18:56:44 +0000 (14:56 -0400)
Sources/libMultiMarkdown/aho-corasick.c

index f94bd60c6ed93e5fad70ad7d871d3593c481b30a..60c057ee295bf72c59502ca575f6230207084916 100644 (file)
@@ -373,13 +373,13 @@ match * ac_trie_search(trie * a, const char * source, size_t start, size_t len)
        size_t temp_state;
 
        // Character being compared
-       int test_value;
+       unsigned char test_value;
        size_t counter = start;
        size_t stop = start + len;
 
        while ((counter < stop) && (source[counter] != '\0')) {
                // Read next character
-               test_value = (int)source[counter++];
+               test_value = (unsigned char)source[counter++];
 
                // Check for path that allows us to match next character
                while (state != 0 && a->node[state].child[test_value] == 0) {