Skip to content

Commit 6320016

Browse files
committed
tom_modem: handle empty lines in read sms response
1 parent e34d8c6 commit 6320016

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

application/tom_modem/src/operations.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ int sms_read(PROFILE_T *profile, void *transport_ptr)
101101
char *line = strtok(response_text, "\n");
102102
int sms_count = 0;
103103

104-
while (line != NULL)
104+
while (line != NULL || line == "\n")
105105
{
106106
if (strncmp(line, "+CMGL:", 6) == 0)
107107
{
@@ -216,7 +216,7 @@ int sms_read_unread(PROFILE_T *profile, void *transport_ptr)
216216
char *line = strtok(response_text, "\n");
217217
int sms_count = 0;
218218

219-
while (line != NULL)
219+
while (line != NULL || line == "\n")
220220
{
221221
if (strncmp(line, "+CMGL:", 6) == 0)
222222
{

0 commit comments

Comments
 (0)