sscanf是错误使用

错误:想不接受最后的000,结果还是接受了,导致溢出

sscanf("1707796440000","%u000",&secondsDiff);
 
sscanf("1707796440000","%10u",&secondsDiff);

错误用法: 不想接收后面的:    结果还是接收了

sscanf(bt_rx_buffer, "wp%s%[^:]:", data);
正确用法:
sscanf(bt_rx_buffer, "wp%[^:]:", data);
posted @ 2024-02-13 12:25  败人两字非傲即惰  阅读(32)  评论(0编辑  收藏  举报