Skip to content

Commit 63a9e9b

Browse files
committed
Replace remaining strlen's
1 parent 7cd8da2 commit 63a9e9b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/SparkFun_u-blox_SARA-R5_Arduino_Library.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2127,7 +2127,7 @@ SARA_R5_error_t SARA_R5::getOperator(String *oper)
21272127
searchPtr = strstr(response, "+COPS:");
21282128
if (searchPtr != nullptr)
21292129
{
2130-
searchPtr += 6; // Move searchPtr to first char
2130+
searchPtr += strlen("+COPS:"); // Move searchPtr to first char
21312131
while (*searchPtr == ' ') searchPtr++; // skip spaces
21322132
mode = *searchPtr; // Read first char -- should be mode
21332133
if (mode == '2') // Check for de-register
@@ -2337,7 +2337,7 @@ SARA_R5_error_t SARA_R5::readSMSmessage(int location, String *unread, String *fr
23372337
searchPtr = strstr(searchPtr, "+CMGR:");
23382338
if (searchPtr != nullptr)
23392339
{
2340-
searchPtr += 6; // Move searchPtr to first char
2340+
searchPtr += strlen("+CMGR:"); // Move searchPtr to first char
23412341
while (*searchPtr == ' ') searchPtr++; // skip spaces
23422342
int pointer = 0;
23432343
while ((*(++searchPtr) != '\"') && (*searchPtr != '\0') && (pointer < 12))
@@ -6026,8 +6026,8 @@ SARA_R5_error_t SARA_R5::parseSocketCloseIndication(String *closeIndication)
60266026
int search;
60276027
int socket;
60286028

6029-
search = closeIndication->indexOf("UUSOCL:");
6030-
search += 7;
6029+
search = closeIndication->indexOf("+UUSOCL:");
6030+
search += strlen("+UUSOCL:");
60316031
while (closeIndication->charAt(search) == ' ') search ++; // skip spaces
60326032

60336033
// Socket will be first integer, should be single-digit number between 0-6:

0 commit comments

Comments
 (0)