PostgreSQL Source Code  git master
strnlen.c File Reference
#include "c.h"
Include dependency graph for strnlen.c:

Go to the source code of this file.

Functions

size_t strnlen (const char *str, size_t maxlen)
 

Function Documentation

◆ strnlen()

size_t strnlen ( const char *  str,
size_t  maxlen 
)

Definition at line 26 of file strnlen.c.

References generate_unaccent_rules::str.

Referenced by fmtstr(), pnstrdup(), and xml_is_document().

27 {
28  const char *p = str;
29 
30  while (maxlen-- > 0 && *p)
31  p++;
32  return p - str;
33 }