Differences

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

Link to this comparison view

Last revisionBoth sides next revision
sdk:scripts:candump [2015/05/05 15:04] – external edit 127.0.0.1sdk:scripts:candump [2018/04/25 10:44] – Do not use strlen on CAN data rosenthal
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]));
     }     }