This shows you the differences between two versions of the page.
Last revision Both sides next revision | |||
sdk:scripts:candump [2015/05/05 15:04] 127.0.0.1 external edit |
sdk:scripts:candump [2018/04/25 10:44] rosenthal Do not use strlen on CAN data |
||
---|---|---|---|
Line 80: | Line 80: | ||
timestamp = strftime("%Y-%m-%d %H:%M:%S", now); | timestamp = strftime("%Y-%m-%d %H:%M:%S", now); | ||
fwrite(fp, sprintf("%s %08x: ", timestamp, id)); | fwrite(fp, sprintf("%s %08x: ", timestamp, id)); | ||
- | for (i = 0; i < strlen(data); i++) { | + | for (i = 0; i < len; i++) { |
fwrite(fp, sprintf("%02x ", data[i])); | fwrite(fp, sprintf("%02x ", data[i])); | ||
} | } |