--- /dev/null
+#include "atoi.h"
+
+int atoi (char *str)
+{
+ int i = 0;
+ int s = 1;
+
+ if (*str == '-') {
+ s = 0;
+ str++;
+ }
+
+ while (*str != 0) {
+ if ((*str <'0') || (*str > '9')) {
+ return 0;
+ }
+ i = i * 10 + (int)(*(str++) - '0');
+ }
+
+ return (s) ? i : -i;
+}
+
+/* vim: set ts=4 sw=4 et */