mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-16 18:13:49 +01:00
drivers/at: at_readline_stop_at_str fix remaining buffer length
This commit is contained in:
parent
85a09681bc
commit
5633a19a37
@ -513,7 +513,6 @@ static ssize_t at_readline_stop_at_str(at_dev_t *dev, char *resp_buf, size_t len
|
|||||||
}
|
}
|
||||||
|
|
||||||
resp_pos++;
|
resp_pos++;
|
||||||
len--;
|
|
||||||
|
|
||||||
if ((size_t)(resp_pos - resp_buf) >= strlen(AT_RECV_EOL)) {
|
if ((size_t)(resp_pos - resp_buf) >= strlen(AT_RECV_EOL)) {
|
||||||
char *const eol_begin = resp_pos - strlen(AT_RECV_EOL);
|
char *const eol_begin = resp_pos - strlen(AT_RECV_EOL);
|
||||||
@ -534,8 +533,10 @@ static ssize_t at_readline_stop_at_str(at_dev_t *dev, char *resp_buf, size_t len
|
|||||||
substr_p++;
|
substr_p++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
len--;
|
||||||
}
|
}
|
||||||
if (len <= 1) {
|
if (len == 1) {
|
||||||
return -ENOBUFS;
|
return -ENOBUFS;
|
||||||
}
|
}
|
||||||
if (res < 0) {
|
if (res < 0) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user