INNER CODE UNIT · C
length
mongodb/mongo-php-driver · src/phongo_bson.c:78
size_t length = 1; /* NULL character */
size_t i;
char* path;
char* ptr;
if (!field_path) {
return estrdup("");
}
if (!field_path->elements) {
return estrdup("");
}
/* Iterate up to and including "size", since the element for the current
* level is stored at that index and is only counted once the level is
* pushed. That index is not always allocated: the array only grows when an
* element is written to it, so stop at "allocated_size" to avoid reading
* past the end of the array. */
for (i = 0; i <= field_path->size && i < field_path->allocated_size; i++) {