u/json: Fix a -Wmaybe-uninitialized on GCC 10.1.0.

This commit is contained in:
Lubosz Sarnecki 2020-07-10 17:13:08 +02:00
parent a5dc31359b
commit 261facd9f1

View file

@ -163,12 +163,11 @@ u_json_get_vec3_array(const cJSON *json, struct xrt_vec3 *out_vec3)
return false;
}
float array[3];
if (cJSON_GetArraySize(json) != 3) {
return false;
}
float array[3] = {0, 0, 0};
const cJSON *item = NULL;
size_t i = 0;
cJSON_ArrayForEach(item, json)