From 2ec62f7fa98e341a20912adc345e7b6c7ee05dd4 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Tue, 29 Oct 2019 14:06:46 +0100 Subject: [PATCH] fixing weird gcc9 bug with strncpy see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88780 for details --- lib/src/phy/rf/rf_zmq_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/phy/rf/rf_zmq_test.c b/lib/src/phy/rf/rf_zmq_test.c index 5909ac9e2..e350978f2 100644 --- a/lib/src/phy/rf/rf_zmq_test.c +++ b/lib/src/phy/rf/rf_zmq_test.c @@ -42,7 +42,7 @@ pthread_t rx_thread; void* ue_rx_thread_function(void* args) { char rf_args[PARAM_LEN]; - strncpy(rf_args, (char*)args, PARAM_LEN); + strncpy(rf_args, (char*)args, PARAM_LEN - 1); rf_args[PARAM_LEN - 1] = 0; // sleep(1); @@ -74,7 +74,7 @@ void* ue_rx_thread_function(void* args) void enb_tx_function(const char* tx_args, bool timed_tx) { char rf_args[PARAM_LEN]; - strncpy(rf_args, tx_args, PARAM_LEN); + strncpy(rf_args, tx_args, PARAM_LEN - 1); rf_args[PARAM_LEN - 1] = 0; printf("opening tx device with args=%s\n", rf_args);