t/slam: fix snprintf warning

Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2140>
This commit is contained in:
Simon Zeni 2024-02-08 12:47:46 -05:00 committed by Simon Zeni
parent 953712fb96
commit 7bbb6d6864

View file

@ -1075,8 +1075,8 @@ setup_ui(TrackerSlam &t)
u_var_add_ro_ff_vec3_f32(&t, t.accel_ff, "Accelerometer");
u_var_add_f32(&t, &t.gravity_correction.z, "Gravity Correction");
for (size_t i = 0; i < t.ui_sink.size(); i++) {
char label[] = "Camera NNNN";
(void)snprintf(label, sizeof(label), "Camera %zu", i);
char label[64] = {0};
snprintf(label, sizeof(label), "Camera %zu", i);
u_var_add_sink_debug(&t, &t.ui_sink[i], label);
}