summaryrefslogtreecommitdiff
path: root/src/ui.c
diff options
context:
space:
mode:
authorMole Shang <[email protected]>2024-03-02 12:55:03 +0800
committerMole Shang <[email protected]>2024-03-02 12:55:03 +0800
commit74ebee5d3a81a39766ba8cd436a548449ea887b0 (patch)
tree69c238d2bff0d69aa4778d22e21de8d519b00dff /src/ui.c
parent62c193bd4e464ec9d847b8abff21e10dfc7b511e (diff)
downloadhinata-74ebee5d3a81a39766ba8cd436a548449ea887b0.tar.gz
hinata-74ebee5d3a81a39766ba8cd436a548449ea887b0.tar.bz2
hinata-74ebee5d3a81a39766ba8cd436a548449ea887b0.zip
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.
Diffstat (limited to 'src/ui.c')
-rw-r--r--src/ui.c7
1 files changed, 4 insertions, 3 deletions
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 <stdlib.h>
#include <string.h>
+#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) {