Project

General

Profile

Bug #6689 ยป tmp.patch

patch against lib/libc/port/locale/mbtowc.c to fix errno handling - Ingo Schwarze, 2016-02-27 06:09 PM

View differences:

usr/src/lib/libc/port/locale/mbtowc.c
45 45
		return (0);
46 46
	}
47 47
	rval = mbrtowc_l(pwc, s, n, &mbs, loc);
48
	if (rval == (size_t)-1 || rval == (size_t)-2)
48
	switch (rval) {
49
	case (size_t)-2:
50
		errno = EILSEQ;
51
		/* FALLTHROUGH */
52
	case (size_t)-1:
49 53
		return (-1);
50
	return ((int)rval);
54
	default:
55
		return ((int)rval);
56
	}
51 57
}
52 58

  
53 59
int
    (1-1/1)