From 17228ed2f245b04fb0ce4288ad2eed159dfb5518 Mon Sep 17 00:00:00 2001 From: "me@ow.nekobit.net" Date: Wed, 13 Apr 2022 01:12:39 +0000 Subject: [PATCH] Timeline error message FossilOrigin-Name: 4fd42539430a883f70f84c5b887ff005c3d392f7022ae4091beb7caa7b334da0 --- dist/treebird40.css | 1 + src/navigation.c | 3 ++- src/timeline.c | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dist/treebird40.css b/dist/treebird40.css index 8055378..ae362cf 100644 --- a/dist/treebird40.css +++ b/dist/treebird40.css @@ -51,6 +51,7 @@ ul #main-page { + background-color: #fff; width: 1000px; margin-left: auto; margin-right: auto; diff --git a/src/navigation.c b/src/navigation.c index dd107e7..b518c35 100644 --- a/src/navigation.c +++ b/src/navigation.c @@ -31,7 +31,8 @@ char* construct_navigation_box(char* start_id, size_t* size) { char* nav_html; - int is_start = strcmp(start_id, prev_id) == 0; + + int is_start = start_id && prev_id ? strcmp(start_id, prev_id) == 0 : 0; size_t s = easprintf(&nav_html, data_navigation_html, start_id, diff --git a/src/timeline.c b/src/timeline.c index 2900bee..35cfb02 100644 --- a/src/timeline.c +++ b/src/timeline.c @@ -33,7 +33,7 @@ void tl_public(struct session* ssn, mastodont_t* api, int local) { - size_t status_count, statuses_html_count; + size_t status_count = 0, statuses_html_count = 0; struct mstdnt_status* statuses = NULL; struct mstdnt_storage storage = { 0 }; char* status_format = NULL, @@ -62,7 +62,7 @@ void tl_public(struct session* ssn, mastodont_t* api, int local) // Construct statuses into HTML status_format = construct_statuses(api, statuses, status_count, &statuses_html_count); if (!status_format) - status_format = "Error in malloc!"; + status_format = construct_error("Couldn't load posts", E_ERROR, 1, NULL); } // Create post box