Differences

This shows you the differences between two versions of the page.

Link to this comparison view

sdk:scripts:candump [2015/05/05 17:04]
127.0.0.1 external edit
sdk:scripts:candump [2018/04/25 12:44] (current)
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]));
     }     }