diff --git a/src/c_regex_traits.cpp b/src/c_regex_traits.cpp index 8baa06b2..494fe65e 100644 --- a/src/c_regex_traits.cpp +++ b/src/c_regex_traits.cpp @@ -499,7 +499,7 @@ void BOOST_REGEX_CALL c_traits_base::do_update_ctype() // now update the character class map, // and lower case map: - std::memset(class_map, 0, map_size); + std::memset(class_map, 0, sizeof(class_map)); for(i = 0; i < map_size; ++i) { if(std::isalpha(i)) @@ -519,9 +519,9 @@ void BOOST_REGEX_CALL c_traits_base::do_update_ctype() if(std::isxdigit(i)) class_map[i] |= char_class_xdigit; } - class_map['_'] |= char_class_underscore; - class_map[' '] |= char_class_blank; - class_map['\t'] |= char_class_blank; + class_map[(unsigned char)'_'] |= char_class_underscore; + class_map[(unsigned char)' '] |= char_class_blank; + class_map[(unsigned char)'\t'] |= char_class_blank; for(i = 0; i < map_size; ++i) { lower_case_map[i] = (char)std::tolower(i); diff --git a/src/w32_regex_traits.cpp b/src/w32_regex_traits.cpp index bcd888d1..ddb8d20e 100644 --- a/src/w32_regex_traits.cpp +++ b/src/w32_regex_traits.cpp @@ -302,7 +302,7 @@ void BOOST_REGEX_CALL w32_traits_base::do_init() { class_map[i] &= char_class_win; } - class_map['_'] |= char_class_underscore; + class_map[(unsigned char)'_'] |= char_class_underscore; LCMapStringA(GetUserDefaultLCID(), LCMAP_LOWERCASE, buf, map_size, lower_case_map, map_size); // // update our collating elements: