aboutsummaryrefslogtreecommitdiff
path: root/lib/error_string.c
diff options
context:
space:
mode:
authorKlaatu <[email protected]>2015-05-17 15:33:21 +1200
committerKlaatu <[email protected]>2015-05-17 15:33:21 +1200
commitb0de699679e8f1e39af847ed172d1ba605b4370c (patch)
tree01dac00471d61f727394e508c613b29cff0ceae5 /lib/error_string.c
bulk upload of source
Diffstat (limited to 'lib/error_string.c')
-rw-r--r--lib/error_string.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/error_string.c b/lib/error_string.c
new file mode 100644
index 0000000..d7fd210
--- /dev/null
+++ b/lib/error_string.c
@@ -0,0 +1,16 @@
+#include "../ninitfeatures.h"
+#if 0
+struct error_table { int n; char *s; }; /*EXTRACT_UNMOD*/
+#endif
+
+char *error_string(struct error_table *table, int n) /*EXTRACT_INCL*/ {
+ static char y[28];
+ char *x=y;
+ for (; table->s; table++)
+ if (table->n == n) return table->s;
+
+ x += str_copy(x,"error=");
+ x += fmt_ulong(x,n);
+ *x = 0;
+ return y;
+}