From 0fb5680a6151c04651472030fe78bae4de9e0114 Mon Sep 17 00:00:00 2001 From: Oliver Hartkopp Date: Mon, 26 Nov 2012 21:44:22 +0100 Subject: [PATCH] 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 --- slcanpty.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.7.4