From c7aa0b7051b867a409e41fbe4c1f3d1ca5e884a6 Mon Sep 17 00:00:00 2001 From: Yegor Yefremov Date: Mon, 13 Jan 2014 14:29:16 +0100 Subject: [PATCH] slcanpty: declare command buffer static 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 Acked-by: Oliver Hartkopp Signed-off-by: Marc Kleine-Budde --- slcanpty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slcanpty.c b/slcanpty.c index 2c1cabe..c062a02 100644 --- a/slcanpty.c +++ b/slcanpty.c @@ -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; -- 2.7.4