MCPcopy Create free account
hub / github.com/SVF-tools/SVF / cJSON_GetArraySize

Function cJSON_GetArraySize

svf/lib/Util/cJSON.cpp:1833–1854  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1831
1832/* Get Array size/item / object item. */
1833CJSON_PUBLIC(int) cJSON_GetArraySize(const cJSON *array)
1834{
1835 cJSON *child = NULL;
1836 size_t size = 0;
1837
1838 if (array == NULL)
1839 {
1840 return 0;
1841 }
1842
1843 child = array->child;
1844
1845 while(child != NULL)
1846 {
1847 size++;
1848 child = child->next;
1849 }
1850
1851 /* FIXME: Can overflow here. Cannot be fixed without breaking the API */
1852
1853 return (int)size;
1854}
1855
1856static cJSON* get_array_item(const cJSON *array, size_t index)
1857{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected