Thread (121 messages) 121 messages, 10 authors, 2021-11-04

Re: [dpdk-dev] [v5] telemetry: fix json output buffer size

From: Thomas Monjalon <hidden>
Date: 2021-10-06 17:38:57

29/09/2021 06:18, Gowrishankar Muthukrishnan:
Fix json output buffer size for an actual data length.

Fixes: 52af6ccb2b39 ("telemetry: add utility functions for creating JSON")
Please could you give a bit more explanations?
What was not working and why?

[...]
- * This function is not for use for values larger than 1k.
+ * This function is not for use for values larger than given buffer length.
  */
 __rte_format_printf(3, 4)
 static inline int
 __json_snprintf(char *buf, const int len, const char *format, ...)
 {
-	char tmp[1024];
+	char tmp[len];
 	va_list ap;
 	int ret;


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help