cryptutils

Cryptographic Software Utilities
git clone http://git.omkov.net/cryptutils
Log | Tree | Refs | README | LICENCE | Download

AuthorJamozed <[email protected]>
Date2021-02-16 01:30:49
Commit5b04688b57c4425a6fb43f608b3523fb9815d276
Parent371feb6ec59036c13a2e1d55f9d88da13d8bb920

lib: Sync error.c with upstream lib

Diffstat

M src/lib/error.c | 3 +++

1 files changed, 3 insertions, 0 deletions

diff --git a/src/lib/error.c b/src/lib/error.c
index b41041f..e0c80d3 100644
--- a/src/lib/error.c
+++ b/src/lib/error.c
@@ -43,16 +43,19 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE.
 char *A0 = NULL;
 bool warned = false;
 
+/* Print an error message and exit */
 noreturn void error(int status, const char *format, ...) {
 	fflush(stdout); if (A0) { fputs(A0, stderr); fputs(": ", stderr); }
 	va_list ap; va_start(ap, format); vfprintf(stderr, format, ap); va_end(ap);
 	fputc('\n', stderr); exit(status);
 }
 
+/* Print a warning message and set the warned flag */
 void warn(const char *format, ...) {
 	fflush(stdout); if (A0) { fputs(A0, stderr); fputs(": ", stderr); }
 	va_list ap; va_start(ap, format); vfprintf(stderr, format, ap); va_end(ap);
 	fputc('\n', stderr); warned = true; return;
 }
 
+/* Shorthand for strerror(errno) */
 char *serr(void) { return strerror(errno); }