diff --git a/src/error.c b/src/error.c index e4c9020..41c52d4 100644 --- a/src/error.c +++ b/src/error.c @@ -42,7 +42,7 @@ char* construct_error(char* error, enum error_type type, unsigned pad, size_t* s size_t s = easprintf(&error_html, data_error_html, class, pad ? "error-pad" : "", - error); + error ? error : "An error occured"); if (size) *size = s; return error_html; } diff --git a/src/status.c b/src/status.c index 2cfbe4a..75d9c92 100644 --- a/src/status.c +++ b/src/status.c @@ -531,9 +531,11 @@ void content_status(struct session* ssn, mastodont_t* api, char** data, int is_r { char* output; // Status context - struct mstdnt_storage storage, status_storage; - struct mstdnt_status* statuses_before, *statuses_after, status = { 0 }; - size_t stat_before_len, stat_after_len; + struct mstdnt_storage storage = {0}, status_storage = {0}; + struct mstdnt_status* statuses_before = NULL, + *statuses_after = NULL, + status = { 0 }; + size_t stat_before_len = 0, stat_after_len = 0; char* before_html = NULL, *stat_html = NULL, *after_html = NULL, *stat_reply = NULL; try_post_status(ssn, api);