From: Ulrich Drepper Date: Fri, 22 Jan 2010 18:22:53 +0000 (-0800) Subject: Simplify test in re_string_skip_chars. X-Git-Tag: fedora/glibc-2.11.90-11~1^2~12 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=5ddf954cf19d43f54ba44f487427d210952e1236;p=glibc.git Simplify test in re_string_skip_chars. --- diff --git a/ChangeLog b/ChangeLog index 60f710797e..14e3199aee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-01-22 Ulrich Drepper + + * posix/regex_internal.c (re_string_skip_chars): Simplify test for + failed mbrtowc call. + 2010-01-22 Jim Meyering [BZ #11186] diff --git a/posix/regex_internal.c b/posix/regex_internal.c index 976dbfc465..8183a29bf6 100644 --- a/posix/regex_internal.c +++ b/posix/regex_internal.c @@ -500,7 +500,7 @@ re_string_skip_chars (re_string_t *pstr, int new_raw_idx, wint_t *last_wc) prev_st = pstr->cur_state; mbclen = __mbrtowc (&wc2, (const char *) pstr->raw_mbs + rawbuf_idx, remain_len, &pstr->cur_state); - if (BE (mbclen == (size_t) -2 || mbclen == (size_t) -1 || mbclen == 0, 0)) + if (BE ((ssize_t) mbclen <= 0, 0)) { /* We treat these cases as a single byte character. */ if (mbclen == 0 || remain_len == 0)