Ensure read_string value is terminated

pull/55/head
Michael Black W9MDB 2018-10-07 07:51:13 -05:00
rodzic 4f828f7215
commit d0bb4de156
1 zmienionych plików z 2 dodań i 0 usunięć

Wyświetl plik

@ -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 */