Fix a bad test resulting in a segfault with ISO-8859-5 locales

Reported by:	Lauri Tirkkonen from Illumos
Approved by:	re@ (gjb)
This commit is contained in:
Baptiste Daroussin 2016-07-03 15:00:12 +00:00
parent d12d6a8476
commit a8bacd6f93
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=302324

View File

@ -310,7 +310,7 @@ _collate_lookup(struct xlocale_collate *table, const wchar_t *t, int *len,
if ((sptr = *state) != NULL) {
*pri = *sptr;
sptr++;
if ((sptr == *state) || (sptr == NULL))
if ((sptr == *state) || (*sptr == 0))
*state = NULL;
else
*state = sptr;