logcat: fix infinity loop when  mbrtowc returns zero

 mbrtowc would return 0​ if the character converted from s (and stored in
 pwc if non-null) was the null character. This will happen when the
 binary buffer corrupted.

Test: boot with corrupted pstore and no spinning
Bug: 221922191
Change-Id: I841810df82dcee4fb864f15e120822ad810318b1
1 file changed
tree: 02884f103e63f1d4f371605d372cb8da8d26ea4a
  1. liblog/
  2. logcat/
  3. logd/
  4. logwrapper/
  5. rust/
  6. OWNERS
  7. PREUPLOAD.cfg
  8. TEST_MAPPING