summaryrefslogtreecommitdiff
path: root/src/util/mystrerror.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/mystrerror.c')
-rw-r--r--src/util/mystrerror.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/util/mystrerror.c b/src/util/mystrerror.c
new file mode 100644
index 000000000..0de07f124
--- /dev/null
+++ b/src/util/mystrerror.c
@@ -0,0 +1,39 @@
+/*++
+/* NAME
+/* mystrerror 3
+/* SUMMARY
+/* convert error number to string
+/* SYNOPSIS
+/* #include <stringops.h>
+/*
+/* const char *mystrerror()
+/* int errnum)
+/* DESCRIPTION
+/* mystrerror() maps an error number to string. Unlike strerror(3)
+/* it returns "Application error" instead of "Success".
+/* LICENSE
+/* .ad
+/* .fi
+/* The Secure Mailer license must be distributed with this software.
+/* AUTHOR(S)
+/* Wietse Venema
+/* porcupine.org
+/*--*/
+
+ /*
+ * System library.
+ */
+#include <sys_defs.h>
+#include <string.h>
+
+ /*
+ * Utility library.
+ */
+#include <stringops.h>
+
+/* mystrerror - convert error number to string */
+
+const char *mystrerror(int errnum)
+{
+ return (errnum ? strerror(errnum) : "Application error");
+}