diff options
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -108,13 +108,15 @@ static void data_file_get_downloaded(const char *dir_name, const char *data_file goto cleanup; } - size_t dir_name_len = strlen(dir_name); - const cJSON *downloaded_item_json = NULL; cJSON_ArrayForEach(downloaded_item_json, downloaded_json) { if(!cJSON_IsObject(downloaded_item_json)) continue; + const cJSON *filler_json = cJSON_GetObjectItemCaseSensitive(downloaded_item_json, "filler"); + if(cJSON_IsTrue(filler_json)) + continue; + const cJSON *time_json = cJSON_GetObjectItemCaseSensitive(downloaded_item_json, "time"); if(!time_json || !cJSON_IsString(time_json)) continue; @@ -128,9 +130,7 @@ static void data_file_get_downloaded(const char *dir_name, const char *data_file strcpy(title, filename_json->valuestring); } else if(title_json && cJSON_IsString(title_json)) { if(is_html) { - strcpy(title, dir_name); - title[dir_name_len] = '/'; - strcpy(title + dir_name_len + 1, title_json->valuestring); + snprintf(title, sizeof(title), "%s/%s", dir_name, title_json->valuestring); } else { strcpy(title, title_json->valuestring); } |