slcanpty: fix wrong usage of nbytes variable

nbytes is used after writing the CAN frame to check for an additional command
in the string buffer. Therefore using nbytes while writing the CAN frame is
wrong. Replace it with 'tmp' which can be used here without problems.

Signed-off-by: ulrich escher<git@myvdr.de>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
pull/7/head
Oliver Hartkopp 2012-11-26 21:44:22 +01:00
parent d547068185
commit 0fb5680a61
1 changed files with 2 additions and 2 deletions

View File

@ -270,8 +270,8 @@ rx_restart:
ptr--; ptr--;
} }
nbytes = write(socket, &frame, sizeof(frame)); tmp = write(socket, &frame, sizeof(frame));
if (nbytes != sizeof(frame)) { if (tmp != sizeof(frame)) {
perror("write socket"); perror("write socket");
return 1; return 1;
} }