mirror of https://github.com/ARMmbed/mbed-os.git
Cellular: ATHandler's mem_str fixed to work on matching strings
parent
273590f615
commit
4e6cbb8f5f
|
@ -1035,7 +1035,7 @@ void ATHandler::set_string(char *dest, const char *src, size_t src_len)
|
|||
|
||||
const char *ATHandler::mem_str(const char *dest, size_t dest_len, const char *src, size_t src_len)
|
||||
{
|
||||
if (dest_len > src_len) {
|
||||
if (dest_len >= src_len) {
|
||||
for (size_t i = 0; i < dest_len - src_len + 1; ++i) {
|
||||
if (memcmp(dest + i, src, src_len) == 0) {
|
||||
return dest + i;
|
||||
|
|
Loading…
Reference in New Issue