From b0de699679e8f1e39af847ed172d1ba605b4370c Mon Sep 17 00:00:00 2001 From: Klaatu Date: Sun, 17 May 2015 15:33:21 +1200 Subject: bulk upload of source --- lib/error_string.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 lib/error_string.c (limited to 'lib/error_string.c') 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; +} -- cgit v1.2.3