Update air724.c
if (!str) { return -1; }
This commit is contained in:
@@ -61,7 +61,6 @@ static int air724_signal_quality_check(void)
|
||||
char echo_buffer[32], *str;
|
||||
int try = 0;
|
||||
|
||||
|
||||
while (try++ < 10)
|
||||
{
|
||||
tos_at_echo_create(&echo, echo_buffer, sizeof(echo_buffer), NULL);
|
||||
@@ -72,6 +71,10 @@ static int air724_signal_quality_check(void)
|
||||
}
|
||||
|
||||
str = strstr(echo.buffer, "+CSQ:");
|
||||
if (!str)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
sscanf(str, "+CSQ:%d,%d", &rssi, &ber);
|
||||
if (rssi != 99) {
|
||||
return 0;
|
||||
@@ -97,6 +100,10 @@ static int air724_gsm_network_check(void)
|
||||
}
|
||||
|
||||
str = strstr(echo.buffer, "+CREG:");
|
||||
if (!str)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
sscanf(str, "+CREG:%d,%d", &n, &stat);
|
||||
if (stat == 1)
|
||||
{
|
||||
@@ -123,6 +130,10 @@ static int air724_gprs_network_check(void)
|
||||
}
|
||||
|
||||
str = strstr(echo.buffer, "+CGREG:");
|
||||
if (!str)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
sscanf(str, "+CGREG:%d,%d", &n, &stat);
|
||||
if (stat == 1)
|
||||
{
|
||||
@@ -464,6 +475,10 @@ static int air724_parse_domain(const char *host_name, char *host_ip, size_t host
|
||||
*/
|
||||
|
||||
str = strstr(echo.buffer, ":");
|
||||
if (!str)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
str += 1;
|
||||
if(*str == '0')
|
||||
{
|
||||
|
Reference in New Issue
Block a user