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.

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

References str.

Referenced by fmtstr(), pg_encoding_mblen_bounded(), pnstrdup(), and PQmblenBounded().