From 74ebee5d3a81a39766ba8cd436a548449ea887b0 Mon Sep 17 00:00:00 2001 From: Mole Shang <135e2@135e2.dev> Date: Sat, 2 Mar 2024 12:55:03 +0800 Subject: tree-wide: use FREE_AND_NULLIFY macro and reformat code Jeez idk why i forgot the pass-by-value feature, so the original version never gets the pointer nullified. Fix it by using our favourite C-style macro. --- src/ui.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/ui.c') diff --git a/src/ui.c b/src/ui.c index 8065237..1448312 100644 --- a/src/ui.c +++ b/src/ui.c @@ -4,15 +4,16 @@ #include #include +#include "nfd.h" #include "nuklear.h" #include "process_url.h" -#include "nfd.h" #include "constants.h" #include "logger.h" #include "ui.h" #include "utils/size_info.h" #include "utils/time_info.h" +#include "utils/utils.h" static nk_size pct; static bool show_app_about; @@ -42,8 +43,8 @@ void load_ui(struct ui_struct *ui) { sprintf(status_string, "%s/%s, %hhu%%", cur_ts, total_ts, (unsigned char)pct); - free_and_nullify(cur_ts); - free_and_nullify(total_ts); + FREE_AND_NULLIFY(cur_ts); + FREE_AND_NULLIFY(total_ts); } } if (ui->stat->is_done) { -- cgit v1.2.3