fix(crash) due to calling isalpha with signed char in get_indentatnion()

This commit is contained in:
Nuno Lopes 2018-01-31 10:51:16 +00:00 committed by Leonardo de Moura
parent 5cee9f8279
commit 9c756e24d3

View file

@ -82,7 +82,7 @@ static unsigned get_indentation(std::string const & s) {
unsigned r = 0;
bool searching = true;
unsigned i = 0;
for (auto it = s.begin(); it != s.end(); it++) {
for (auto it = (const unsigned char*)s.data(), e = (const unsigned char*)s.data() + s.size(); it != e; ++it) {
if (*it == '\n') {
i = 0;
searching = true;