From: Oliver Hartkopp Date: Mon, 26 Nov 2012 20:44:22 +0000 (+0100) Subject: slcanpty: fix wrong usage of nbytes variable X-Git-Tag: 0.1~69 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0fb5680a6151c04651472030fe78bae4de9e0114;p=profile%2Fivi%2Fcan-utils.git 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 Signed-off-by: Oliver Hartkopp --- diff --git a/slcanpty.c b/slcanpty.c index b45b1a8..67a7491 100644 --- a/slcanpty.c +++ b/slcanpty.c @@ -270,8 +270,8 @@ rx_restart: ptr--; } - nbytes = write(socket, &frame, sizeof(frame)); - if (nbytes != sizeof(frame)) { + tmp = write(socket, &frame, sizeof(frame)); + if (tmp != sizeof(frame)) { perror("write socket"); return 1; }