Skip to content

Commit

Permalink
slcanpty: declare command buffer static
Browse files Browse the repository at this point in the history
ASCII command buffer char buf[200] must be declared as static,
because it holds incomplete commands between pty2can() calls.
Without static it is not guaranteed, that buf retains the same
data between calls.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
  • Loading branch information
yegorich authored and marckleinebudde committed Jan 16, 2014
1 parent 31936b5 commit c7aa0b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion slcanpty.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ int pty2can(int pty, int socket, struct can_filter *fi,
{
int nbytes;
char cmd;
char buf[200];
static char buf[200];
char replybuf[10]; /* for answers to received commands */
int ptr;
struct can_frame frame;
Expand Down

0 comments on commit c7aa0b7

Please sign in to comment.