mblen.c 395 B

123456789101112131415161718
  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. /* $Id$ */
  6. #include <stdlib.h>
  7. #include <limits.h>
  8. #define CHAR_SHIFT 8
  9. int
  10. (mblen)(const char *s, size_t n)
  11. {
  12. if (s == (const char *)NULL) return 0; /* no state dependent codings */
  13. if (n <= 0) return 0;
  14. return (*s != 0);
  15. }