summaryrefslogtreecommitdiffstats
path: root/contrib/syslinux-4.02/com32/lib/strerror.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/syslinux-4.02/com32/lib/strerror.c')
-rw-r--r--contrib/syslinux-4.02/com32/lib/strerror.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/contrib/syslinux-4.02/com32/lib/strerror.c b/contrib/syslinux-4.02/com32/lib/strerror.c
new file mode 100644
index 0000000..8dbe74a
--- /dev/null
+++ b/contrib/syslinux-4.02/com32/lib/strerror.c
@@ -0,0 +1,23 @@
+/*
+ * strerror.c
+ */
+
+#include <string.h>
+
+char *strerror(int errnum)
+{
+ static char message[32] = "error "; /* enough for error 2^63-1 */
+
+ char numbuf[32];
+ char *p;
+
+ p = numbuf + sizeof numbuf;
+ *--p = '\0';
+
+ do {
+ *--p = (errnum % 10) + '0';
+ errnum /= 10;
+ } while (errnum);
+
+ return (char *)memcpy(message + 6, p, (numbuf + sizeof numbuf) - p);
+}