From: Oliver Hartkopp Date: Sat, 28 Jan 2012 16:30:33 +0000 (+0100) Subject: cangen: set unused payload to zero X-Git-Tag: 0.1~84 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8197afe2c1f88f1eea06f98887c99daa0067fa11;p=profile%2Fivi%2Fcan-utils.git cangen: set unused payload to zero --- diff --git a/cangen.c b/cangen.c index 981147e..20cc921 100644 --- a/cangen.c +++ b/cangen.c @@ -350,6 +350,10 @@ int main(int argc, char **argv) *(unsigned long*)(&frame.data[4]) = random(); } + /* set unused payload data to zero like the CAN driver does it on rx */ + if (frame.can_dlc < 8) + memset(&frame.data[frame.can_dlc], 0, 8 - frame.can_dlc); + if (verbose) { printf(" %s ", argv[optind]);