diff --git a/quad/src/quad_app/log_data.c b/quad/src/quad_app/log_data.c index 6c3f5c3e89a3e8fea778019b2fe8d96a0a8d6bd3..a72129f13aa22942f1884e3c3608f7227c21405e 100644 --- a/quad/src/quad_app/log_data.c +++ b/quad/src/quad_app/log_data.c @@ -20,7 +20,7 @@ // Current index of the log array int arrayIndex = 0; // Size of the array -int arraySize = LOG_STARTING_SIZE; +int arraySize = 0; struct graph_tuple { // Tuple for int block_id; @@ -38,7 +38,7 @@ struct graph_tuple log_params[MAX_LOG_NUM]; size_t n_outputs; size_t n_params; -float* logArray; +float* logArray = NULL; int row_size; static char units_output_str[512] = {}; @@ -112,6 +112,8 @@ void initialize_logging(log_t* log_struct, parameter_t* ps) { logArray = malloc(needed_memory); if (!logArray) { // malloc failed arraySize = 0; + } else { + arraySize = LOG_STARTING_SIZE; } }