Back to index

glibc  2.9
Functions
wcsnlen.c File Reference
#include <wchar.h>

Go to the source code of this file.

Functions

size_t __wcsnlen (wchar_t *s, size_t maxlen) const

Function Documentation

size_t __wcsnlen ( wchar_t *  s,
size_t  maxlen 
) const

Definition at line 25 of file wcsnlen.c.

{
  size_t len = 0;

  while (maxlen > 0 && s[len] != L'\0')
    {
      ++len;
      if (--maxlen == 0 || s[len] == L'\0')
       return len;
      ++len;
      if (--maxlen == 0 || s[len] == L'\0')
       return len;
      ++len;
      if (--maxlen == 0 || s[len] == L'\0')
       return len;
      ++len;
      --maxlen;
    }

  return len;
}

Here is the caller graph for this function: