fixing weird gcc9 bug with strncpy

see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88780 for details
This commit is contained in:
Andre Puschmann 2019-10-29 14:06:46 +01:00
parent 1d6f72b478
commit 2ec62f7fa9
1 changed files with 2 additions and 2 deletions

View File

@ -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);