dont write out of bounds

This commit is contained in:
2025-01-07 02:56:30 +01:00
parent 0e8b867323
commit 83fd0e8a8b

View File

@@ -77,7 +77,7 @@ static void json_parse_task(void *pvparameters){
uint8_t line = 0;
char *item = start;
char txt[5][50];
char txt[6][50];
while((item = strstr(item+1, "{ \"stopID\":")) != 0){
char symbol[10];
get_json_string(item, "symbol", symbol);
@@ -106,7 +106,7 @@ static void json_parse_task(void *pvparameters){
}
sprintf(txt[line], "%.3s\t%.20s\t%.3s", symbol, direction, countdown);
//sprintf(txt[line], "%.3s\t%.20s\t%.4s", symbol, direction, countdown);
printf("line = %d: %s\n", line, txt[line]);
printf("\n");