Skip to content

Commit a0cc22e

Browse files
author
Mirela Chirica
committed
Cellular: Fix AT Handler compile warning
1 parent c8d72c5 commit a0cc22e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

features/cellular/framework/AT/ATHandler.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ ssize_t ATHandler::read(char *buf, size_t size, bool read_even_stop_tag, bool he
483483
size_t buf_idx = 0;
484484

485485
for (; read_idx < (read_size + match_pos); read_idx++) {
486-
char c = get_char();
486+
int c = get_char();
487487
buf_idx = hex ? read_idx/2 : read_idx;
488488
if (c == -1) {
489489
pbuf[buf_idx] = '\0';
@@ -515,15 +515,15 @@ ssize_t ATHandler::read(char *buf, size_t size, bool read_even_stop_tag, bool he
515515
pbuf[buf_idx] = c;
516516
} else {
517517
if (read_idx % 2 == 0) {
518-
upper = hex_str_to_int(&c, 1);
518+
upper = hex_str_to_int((const char*)&c, 1);
519519
} else {
520-
lower = hex_str_to_int(&c, 1);
520+
lower = hex_str_to_int((const char*)&c, 1);
521521
pbuf[buf_idx] = ((upper<<4) & 0xF0) | (lower & 0x0F);
522522
}
523523
}
524524
}
525525

526-
return buf_idx + 1;
526+
return buf_idx;
527527
}
528528

529529
ssize_t ATHandler::read_string(char *buf, size_t size, bool read_even_stop_tag)

0 commit comments

Comments
 (0)