xiaoxiang781216 commented on code in PR #8726:
URL: https://github.com/apache/nuttx/pull/8726#discussion_r1183336492


##########
arch/arm/src/phy62xx/uart.h:
##########
@@ -165,7 +165,12 @@ int hal_uart_set_tx_buf(UART_INDEX_e uart_index, uint8_t 
*buf,
     uint16_t size);
 int hal_uart_get_tx_ready(UART_INDEX_e uart_index);
 int hal_uart_send_buff(UART_INDEX_e uart_index, uint8_t *buff, uint16_t len);
-#define logx(...) {char tmp_str[128]; sprintf(tmp_str, __VA_ARGS__); 
hal_uart_send_buff(0, &tmp_str, strlen(tmp_str) + 1);}
+#define logx(...) \
+  do { \
+    char tmp_str[128]; \
+    snprintf(tmp_str, sizeof(tmp_str), __VA_ARGS__); \
+    hal_uart_send_buff(0, &tmp_str, strlen(tmp_str) + 1); \
+  } while (0)

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to