Skip to content

Commit 181d0b5

Browse files
jmikolajpauli
authored and
jpauli
committed
Use correct macro for fetching zval string length (#33)
1 parent 5be7a75 commit 181d0b5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Book/hashtables/hashtable_api.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,8 @@ The only caveat is what "string length" means in this context: In the hashtable
187187
which do not include the NUL byte in the string length.
188188

189189
What does this mean practically? When passing a literal string, the string length will be ``sizeof("foo")`` rather than
190-
``sizeof("foo")-1``. When passing a string from a zval, the string length will be ``Z_STRVAL_P(zv)+1`` rather than
191-
``Z_STRVAL_P(zv)``.
190+
``sizeof("foo")-1``. When passing a string from a zval, the string length will be ``Z_STRLEN_P(zv)+1`` rather than
191+
``Z_STRLEN_P(zv)``.
192192

193193
Apart from this the functions are used in exactly the same way as the index functions::
194194

@@ -742,4 +742,4 @@ The last of the comparison-related function is used for finding the smallest or
742742
);
743743

744744
For ``flag=0`` the minimum value is written into ``pData``, for ``flag=1`` the maximum value. If the hashtable is empty
745-
the function will return ``FAILURE`` (as min/max are not well-defined for an empty array).
745+
the function will return ``FAILURE`` (as min/max are not well-defined for an empty array).

0 commit comments

Comments
 (0)