From 1d85ddd0e9cc2be81d2e5edad980578ee38f48ca Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Thu, 18 Jul 2024 18:55:42 +0900 Subject: [PATCH] Improve error print --- src/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index f740c08..c89443d 100644 --- a/src/main.c +++ b/src/main.c @@ -71,8 +71,11 @@ int main(int argc, const char **argv) { __attribute__((cleanup(simple_archiver_free_state))) SDArchiverState *state = simple_archiver_init_state(&parsed); - if (simple_archiver_write_all(file, state, filenames) != SDAS_SUCCESS) { + int ret = simple_archiver_write_all(file, state, filenames); + if (ret != SDAS_SUCCESS) { fprintf(stderr, "Error during writing.\n"); + char *error_str = simple_archiver_error_to_string(ret); + fprintf(stderr, " %s\n", error_str); } fclose(file); } else if ((parsed.flags & 3) == 2) {