summaryrefslogtreecommitdiffstats
path: root/newlib/libc/stdlib/mbrlen.c
blob: 8f0c648b96f1e14be7c22a94254875b5112a68d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <wchar.h>
#include <stdlib.h>
#include <stdio.h>
#include <reent.h>
#include <errno.h>

size_t
mbrlen(const char *s, size_t n, mbstate_t *ps)
{
  mbstate_t internal;

  return mbrtowc(NULL, s, n, ps != NULL ? ps : &internal);
}