Parcourir la source

Fixed issue #26: When there was a connection error, there was no json found so all the alarms would be discarted.

jancoow il y a 9 ans
Parent
commit
0e31af0737
1 fichiers modifiés avec 1 ajouts et 0 suppressions
  1. 1 0
      network.c

+ 1 - 0
network.c

@@ -113,6 +113,7 @@ void parseAlarmJson(char* content){
     r = jsmn_parse(&p, content, strlen(content), token, sizeof(token)/sizeof(token[0]));
     if (r < 0) {
         printf("Failed to parse JSON: %d \n", r);
+        return;
     }else{
         printf("Aantal tokens found: %d \n", r);
     }