MCPcopy Index your code
hub / github.com/DaveGamble/cJSON / get_array_item

Function get_array_item

cJSON.c:1907–1924  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1905}
1906
1907static cJSON* get_array_item(const cJSON *array, size_t index)
1908{
1909 cJSON *current_child = NULL;
1910
1911 if (array == NULL)
1912 {
1913 return NULL;
1914 }
1915
1916 current_child = array->child;
1917 while ((current_child != NULL) && (index > 0))
1918 {
1919 index--;
1920 current_child = current_child->next;
1921 }
1922
1923 return current_child;
1924}
1925
1926CJSON_PUBLIC(cJSON *) cJSON_GetArrayItem(const cJSON *array, int index)
1927{

Callers 4

cJSON_GetArrayItemFunction · 0.70
cJSON_InsertItemInArrayFunction · 0.70
cJSON_ReplaceItemInArrayFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…