mblen.c 388 B

1234567891011121314151617181920
  1. /*
  2. * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
  3. * See the copyright notice in the ACK home directory, in the file "Copyright".
  4. */
  5. /* $Header$ */
  6. #include <stdlib.h>
  7. #include <limits.h>
  8. int
  9. mblen(const char *s, size_t n)
  10. {
  11. if (s == (char *)NULL)
  12. return 0;
  13. if (*s == '\0')
  14. return 0;
  15. if (n < 1 || n > MB_CUR_MAX)
  16. return -1;
  17. return MB_LEN_MAX;
  18. }