File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -136,13 +136,13 @@ static int32_t at_sdio_read_data(uint8_t* data, int32_t len)
136136 break ;
137137 }
138138
139- esp_at_sdio_list_t * p_list = pHead ;
140-
141- if (len < p_list -> left_len ) {
142- memcpy (data + copy_len , p_list -> pbuf + p_list -> pos , len );
143- p_list -> pos += len ;
144- p_list -> left_len -= len ;
145- copy_len += len ;
139+ esp_at_sdio_list_t * p_list = pHead ;
140+ uint32_t to_read_len = len - copy_len ;
141+ if (to_read_len < p_list -> left_len ) {
142+ memcpy (data + copy_len , p_list -> pbuf + p_list -> pos , to_read_len );
143+ p_list -> pos += to_read_len ;
144+ p_list -> left_len -= to_read_len ;
145+ copy_len += to_read_len ;
146146 } else {
147147 memcpy (data + copy_len , p_list -> pbuf + p_list -> pos , p_list -> left_len );
148148 p_list -> pos += p_list -> left_len ;
You can’t perform that action at this time.
0 commit comments