From d5b2dcb50d4324450f7d807fef7bfa6004b44e14 Mon Sep 17 00:00:00 2001 From: nwright-mcc Date: Wed, 18 Oct 2023 10:42:23 -0400 Subject: [PATCH] Fix buffer size too small --- examples/c/daqhats_utils.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/c/daqhats_utils.h b/examples/c/daqhats_utils.h index 9a3abd1..420b53d 100644 --- a/examples/c/daqhats_utils.h +++ b/examples/c/daqhats_utils.h @@ -208,10 +208,10 @@ void convert_tc_type_to_string(uint8_t tc_type, /* This function converts the mask of channels defined by the channel_mask parameter and sets the chans_str parameter, which is passed by reference, to a comma separated string respresentation of the channel numbers. */ -void convert_chan_mask_to_string(uint8_t channel_mask, char* chans_str) +void convert_chan_mask_to_string(uint32_t channel_mask, char* chans_str) { int i = 0; - char chan_string[8]; + char chan_string[16]; if (chans_str == NULL) return; @@ -235,7 +235,7 @@ void convert_chan_mask_to_string(uint8_t channel_mask, char* chans_str) parameter and sets the chans parameter, which is passed by reference, to an array of channel numbers. The return value is an integer representing the number of channels. */ -int convert_chan_mask_to_array(uint8_t channel_mask, int chans[]) +int convert_chan_mask_to_array(uint32_t channel_mask, int chans[]) { int i = 0; int chan_count = 0;