From d0bb4de1561aaec61ff6e432a0df4e393655e45d Mon Sep 17 00:00:00 2001 From: Michael Black W9MDB Date: Sun, 7 Oct 2018 07:51:13 -0500 Subject: [PATCH] Ensure read_string value is terminated --- src/iofunc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/iofunc.c b/src/iofunc.c index 8cd0966a9..432375cae 100644 --- a/src/iofunc.c +++ b/src/iofunc.c @@ -692,6 +692,8 @@ int HAMLIB_API read_string(hamlib_port_t *p, /* Store the time of the read loop start */ gettimeofday(&start_time, NULL); + rxbuffer[0] = 0; /* ensure string is terminated */ + while (total_count < rxmax - 1) { tv = tv_timeout; /* select may have updated it */