shithub: rott

Download patch

ref: 5842f05ec5adbe3ed2d00b90b84945ea4c2fc78c
parent: 2a0405f5f4d1c1afc80edb786d36748a6f39fdb8
author: LTCHIPS <ltchips994@gmail.com>
date: Mon Jul 9 17:08:02 EDT 2018

readding itoa and other removed functions to dosutil, since apparently said removed functions didn't exist in stdlib

--- a/src/dosutil.c
+++ b/src/dosutil.c
@@ -129,6 +129,64 @@
     return lenResult;
 }
 
+char *strlwr(char *s)
+{
+    char *p = s;
+
+    while (*p) {
+        *p = tolower(*p);
+        p++;
+    }
+
+    return s;
+}
+
+char *strupr(char *s)
+{
+    char *p = s;
+
+    while (*p) {
+        *p = toupper(*p);
+        p++;
+    }
+
+    return s;
+}
+
+char *itoa(int value, char *string, int radix)
+{
+    switch (radix) {
+    case 10:
+        sprintf(string, "%d", value);
+        break;
+    case 16:
+        sprintf(string, "%x", value);
+        break;
+    default:
+        STUB_FUNCTION;
+        break;
+    }
+
+    return string;
+}
+
+char *ltoa(long value, char *string, int radix)
+{
+    switch (radix) {
+    case 10:
+        sprintf(string, "%ld", value);
+        break;
+    case 16:
+        sprintf(string, "%lx", value);
+        break;
+    default:
+        STUB_FUNCTION;
+        break;
+    }
+
+    return string;
+}
+
 
 /* from Dan Olson */
 void put_dos2ansi(byte attrib)