PostgreSQL Source Code
git master
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
Functions
Variables
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
Data Fields
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
f
h
i
n
o
p
r
s
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
Files
File List
Globals
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
strnlen.c
Go to the documentation of this file.
1
/*-------------------------------------------------------------------------
2
*
3
* strnlen.c
4
* Fallback implementation of strnlen().
5
*
6
*
7
* Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
8
* Portions Copyright (c) 1994, Regents of the University of California
9
*
10
* IDENTIFICATION
11
* src/port/strnlen.c
12
*
13
*-------------------------------------------------------------------------
14
*/
15
16
#include "
c.h
"
17
18
/*
19
* Implementation of posix' strnlen for systems where it's not available.
20
*
21
* Returns the number of characters before a null-byte in the string pointed
22
* to by str, unless there's no null-byte before maxlen. In the latter case
23
* maxlen is returned.
24
*/
25
size_t
26
strnlen
(
const
char
*
str
,
size_t
maxlen)
27
{
28
const
char
*p =
str
;
29
30
while
(maxlen-- > 0 && *p)
31
p++;
32
return
p -
str
;
33
}
c.h
str
const char * str
Definition:
hashfn_unstable.h:263
strnlen
size_t strnlen(const char *str, size_t maxlen)
Definition:
strnlen.c:26
src
port
strnlen.c
Generated on Sat Nov 23 2024 18:13:26 for PostgreSQL Source Code by
1.9.1