From a455a256985d221097893362b0a1d6456b326600 Mon Sep 17 00:00:00 2001 From: "me@ow.nekobit.net" Date: Fri, 22 Apr 2022 12:09:39 +0000 Subject: [PATCH] Fix check_type FossilOrigin-Name: 7eb97884ad66a87dfcad49715a52b582639279eddb0bc2df0437f5629c5628d9 --- src/status.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/status.c b/src/status.c index 977fc16..58515b6 100644 --- a/src/status.c +++ b/src/status.c @@ -182,9 +182,10 @@ char* construct_status_interactions(int fav_count, char* construct_status_interaction_profile(struct interact_profile_args* args, size_t index, int* size) { + size_t s = 0; // Might change struct mstdnt_account* check_type = args->reblogs; - char* profile_html; + char* profile_html = NULL; // Loop through reblogs first, then favourites if (index >= args->reblogs_len) @@ -203,9 +204,11 @@ char* construct_status_interaction_profile(struct interact_profile_args* args, s return NULL; } } - - size_t s = easprintf(&profile_html, data_status_interaction_profile_html, - check_type[index].acct, check_type[index].avatar); + + // Usually means no reblogs if check_type is NULL + if (check_type) + s = easprintf(&profile_html, data_status_interaction_profile_html, + check_type[index].acct, check_type[index].avatar); if (size) *size = s; return profile_html;