- /* Ignore dest and len, don't store *srcp at the end, and
- don't clobber *ps. */
- mbstate_t state = *ps;
- size_t totalcount = 0;
-
- for (;; src++)
- {
- wchar_t wc = *src;
- size_t ret = wcrtomb (buf, wc, &state);
-
- if (ret == (size_t)(-1))
- goto bad_input2;
- if (wc == 0)
- {
- /* Here mbsinit (&state). */
- break;
- }
- totalcount += ret;
- }
- return totalcount;
+ /* Ignore dest and len, don't store *srcp at the end, and
+ don't clobber *ps. */
+ mbstate_t state = *ps;
+ size_t totalcount = 0;
+
+ for (;; src++)
+ {
+ wchar_t wc = *src;
+ size_t ret = wcrtomb (buf, wc, &state);
+
+ if (ret == (size_t)(-1))
+ goto bad_input2;
+ if (wc == 0)
+ {
+ /* Here mbsinit (&state). */
+ break;
+ }
+ totalcount += ret;
+ }
+ return totalcount;