aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/git.c
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2022-08-26 06:53:49 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2022-08-26 07:15:45 +0200
commit964f8f40639453ddb42aa3d2aea9e1519b2d74cb (patch)
tree65c4e809a514d6a6fba4e2dfdb7df117e5e40e6c /src/git.c
parentfix pthread error handling (diff)
downloadcimple-964f8f40639453ddb42aa3d2aea9e1519b2d74cb.tar.gz
cimple-964f8f40639453ddb42aa3d2aea9e1519b2d74cb.zip
fix macros
do { ... } while (0) is objectively better: https://stackoverflow.com/q/1067226/514684
Diffstat (limited to '')
-rw-r--r--src/git.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/git.c b/src/git.c
index 3572d67..adf40e4 100644
--- a/src/git.c
+++ b/src/git.c
@@ -5,11 +5,11 @@
#include <git2.h>
#define git_print_error(fn) \
- { \
+ do { \
const git_error *error = git_error_last(); \
const char *msg = error && error->message ? error->message : "???"; \
print_error("%s: %s\n", fn, msg); \
- }
+ } while (0)
int libgit_init()
{