]> git.ozlabs.org Git - petitboot/commitdiff
lib/fold: Catch error case from mbrtowc()
authorSam Mendoza-Jonas <sam@mendozajonas.com>
Thu, 3 Mar 2016 02:31:18 +0000 (13:31 +1100)
committerSam Mendoza-Jonas <sam@mendozajonas.com>
Tue, 15 Mar 2016 03:34:41 +0000 (14:34 +1100)
The assert() statement in fold_text() only evaluates in a debug build.
If mbrtowc() encounters an error return the portion of the string that
has been parsed and stop.

This avoids an issue with glibc 2.22 where previous calls to
setlocale() failed and set an unsuitable locale. Since the error was not
caught this resulted in an infinite loop when trying to access the
Language screen.

Signed-off-by: Sam Mendoza-Jonas <sam@mendozajonas.com>

No differences found