X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=cpp%2Fsrc%2Fphonenumbers%2Futf%2Funilib.cc;h=e890f9743ecbd8404fc690e8c44472a2a4b8dd12;hb=34b8ec1e5cc8bf27efafb541d8095253ea578f9c;hp=918134e8ca716a473f04ee35ff6eefcd2a46a1b0;hpb=1e538719f2aec83cf134a6ec0e520576f5266d05;p=platform%2Fupstream%2Flibphonenumber.git diff --git a/cpp/src/phonenumbers/utf/unilib.cc b/cpp/src/phonenumbers/utf/unilib.cc index 918134e..e890f97 100644 --- a/cpp/src/phonenumbers/utf/unilib.cc +++ b/cpp/src/phonenumbers/utf/unilib.cc @@ -53,8 +53,8 @@ int SpanInterchangeValid(const char* begin, int byte_length) { int bytes_consumed = charntorune(&rune, p, end - p); // We want to accept Runeerror == U+FFFD as a valid char, but it is used // by chartorune to indicate error. Luckily, the real codepoint is size 3 - // while errors return bytes_consumed == 1. - if ((rune == Runeerror && bytes_consumed == 1) || + // while errors return bytes_consumed <= 1. + if ((rune == Runeerror && bytes_consumed <= 1) || !IsInterchangeValidCodepoint(rune)) { break; // Found }