diff options
author | 2017-10-26 16:24:51 +0200 | |
---|---|---|
committer | 2017-10-26 16:24:51 +0200 | |
commit | a08e8a2d04821b4dcdfabe9f8e2d05a5cdac0d8d (patch) | |
tree | 463e846d897487bcaa628c7a8c03b601d4b263cd /core/save-git.c | |
parent | 2c67b387ea5571675db68c46b7879b4746571fd9 (diff) | |
parent | 405923ecfdca7993a3f6433eba4f0de0d03161f5 (diff) | |
download | subsurface-a08e8a2d04821b4dcdfabe9f8e2d05a5cdac0d8d.tar.gz |
Merge pull request #726 from Subsurface-divelog/rewriteErrorHandling
Rewrite error handling
Diffstat (limited to 'core/save-git.c')
-rw-r--r-- | core/save-git.c | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/core/save-git.c b/core/save-git.c index 548664239..f0752f549 100644 --- a/core/save-git.c +++ b/core/save-git.c @@ -440,42 +440,6 @@ static void create_dive_buffer(struct dive *dive, struct membuffer *b) save_dive_temperature(b, dive); } -static struct membuffer error_string_buffer = { 0 }; - -/* - * Note that the act of "getting" the error string - * buffer doesn't de-allocate the buffer, but it does - * set the buffer length to zero, so that any future - * error reports will overwrite the string rather than - * append to it. - */ -const char *get_error_string(void) -{ - const char *str; - - if (!error_string_buffer.len) - return ""; - str = mb_cstring(&error_string_buffer); - error_string_buffer.len = 0; - return str; -} - -int report_error(const char *fmt, ...) -{ - struct membuffer *buf = &error_string_buffer; - - /* Previous unprinted errors? Add a newline in between */ - if (buf->len) - put_bytes(buf, "\n", 1); - VA_BUF(buf, fmt); - mb_cstring(buf); - return -1; -} - -void report_message(const char *msg) -{ - (void)report_error("%s", msg); -} /* * libgit2 has a "git_treebuilder" concept, but it's broken, and can not |