From 1c62fd8219b4a1e6e0a0ad3d1d1c116a34d49b46 Mon Sep 17 00:00:00 2001 From: Masahiko AMANO Date: Sat, 18 Feb 2023 01:01:02 +0300 Subject: [PATCH] fix(tfm): fix CLI app --- tfm/cli/tfm-cli.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tfm/cli/tfm-cli.c b/tfm/cli/tfm-cli.c index 43ce4e3..7109771 100644 --- a/tfm/cli/tfm-cli.c +++ b/tfm/cli/tfm-cli.c @@ -142,7 +142,7 @@ int menu_add_sasa(const char *arg) { fprintf(stderr, ERROR("Failed to add file to database: sasahyou is full")"\n"); return 1; } - if (tanabata_sasa_add(&tanabata, arg) == 0 && + if (tanabata_sasa_add(&tanabata, arg).id != HOLE_ID && tanabata_save(&tanabata) == 0) { printf(SUCCESS("Successfully added file to database")"\n"); return 0; @@ -165,7 +165,7 @@ int menu_add_tanzaku(const char *arg) { printf(HIGHLIGHT("Enter tanzaku description:")"\n"); fgets(description, 4096, stdin); description[strlen(description) - 1] = 0; - if (tanabata_tanzaku_add(&tanabata, arg, description) == 0 && + if (tanabata_tanzaku_add(&tanabata, arg, description).id != HOLE_ID && tanabata_save(&tanabata) == 0) { printf(SUCCESS("Successfully added tanzaku to database")"\n"); return 0;