The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

u/logging: Use truncating snprintf utility for JSON log

When using the JSON logging mode, truncate log strings to
ensure they fit in the allocated message buffer

Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2373>

+1 -1
+1 -1
src/xrt/auxiliary/util/u_logging.c
··· 339 339 340 340 // Add message. 341 341 char msg_buf[LOG_BUFFER_SIZE]; 342 - vsprintf(msg_buf, format, args); 342 + u_truncate_vsnprintf(msg_buf, LOG_BUFFER_SIZE, format, args); 343 343 cJSON_AddItemToObject(root, "message", cJSON_CreateString(msg_buf)); 344 344 345 345 // Get string and print to stderr.