s = empty_string;
n = 1;
} else if (*s == '\0') {
- /* According to the ISO C 89 standard this is the expected behaviour. */
+ /* According to the ISO C 89 standard this is the expected behaviour. */
return 0;
} else if (!n) {
/* TODO: change error code? */
if (!s) {
n = SIZE_MAX;
}
- s = buf;
+ s = buf;
store = 0;
}
int wcswidth(const wchar_t *pwcs, size_t n)
{
- int h, l, m, count;
- wchar_t wc;
- unsigned char b;
+ int h, l, m, count;
+ wchar_t wc;
+ unsigned char b;
if (ENCODING == __ctype_encoding_7_bit) {
size_t i;
}
#endif /* __CTYPE_HAS_UTF_8_LOCALES */
- for (count = 0 ; n && (wc = *pwcs++) ; n--) {
+ for (count = 0 ; n && (wc = *pwcs++) ; n--) {
if (wc <= 0xff) {
/* If we're here, wc != 0. */
if ((wc < 32) || ((wc >= 0x7f) && (wc < 0xa0))) {
}
++count;
- }
+ }
- return count;
+ return count;
}
#else /* __UCLIBC_HAS_LOCALE__ */
}
}
- for (count = 0 ; n && (wc = *pwcs++) ; n--) {
+ for (count = 0 ; n && (wc = *pwcs++) ; n--) {
if (wc <= 0xff) {
/* If we're here, wc != 0. */
if ((wc < 32) || ((wc >= 0x7f) && (wc < 0xa0))) {
int wcwidth(wchar_t wc)
{
- return wcswidth(&wc, 1);
+ return wcswidth(&wc, 1);
}
#endif