From 1e6de6cdb2bdaee837e862c0a52a2b8f8251760b Mon Sep 17 00:00:00 2001 From: Michael Black Date: Sun, 22 Dec 2019 08:15:25 -0600 Subject: [PATCH] Fix barrett strtok to be thread safe --- barrett/barrett.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/barrett/barrett.c b/barrett/barrett.c index 257b6c5ef..2239549a4 100644 --- a/barrett/barrett.c +++ b/barrett/barrett.c @@ -60,7 +60,7 @@ static int barrett_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq); static int barrett_set_split_vfo(RIG *rig, vfo_t rxvfo, split_t split, vfo_t txvfo); -static int barrett_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, +static int barrett_get_split_vfo(RIG *rig, vfo_t rxvfo, split_t *split, vfo_t *txvfo); static int barrett_get_level(RIG *rig, vfo_t vfo, setting_t level, @@ -317,7 +317,8 @@ int barrett_transaction(RIG *rig, char *cmd, int expected, char **result) // Several commands can return multiline strings and we'll leave them alone if (n == 1) { - strtok(*result, "\r"); + char *dummy; + strtok_r(*result, "\r", &dummy); } dump_hex((const unsigned char *)*result, strlen(*result));