aboutsummaryrefslogtreecommitdiff
path: root/std
diff options
context:
space:
mode:
Diffstat (limited to 'std')
-rw-r--r--std/stdlib.c2
-rw-r--r--std/stdlib.sloth1
2 files changed, 2 insertions, 1 deletions
diff --git a/std/stdlib.c b/std/stdlib.c
index 3878817..4a650a4 100644
--- a/std/stdlib.c
+++ b/std/stdlib.c
@@ -41,7 +41,7 @@ int as_int(float x) {
}
char* istr(int x) {
- char* snum[100];
+ char* snum = malloc(12);
sprintf(snum, "%d", x);
//char* result = snum;
return snum;
diff --git a/std/stdlib.sloth b/std/stdlib.sloth
index 4213e0a..4d3617f 100644
--- a/std/stdlib.sloth
+++ b/std/stdlib.sloth
@@ -6,5 +6,6 @@ foreign fn parse_int(str: String) Int;
foreign fn termpos(x: Int, y: Int);
foreign fn as_int(x: Float) Int;
foreign fn istr(x: Int) String;
+foreign fn system(cmd: String) Int;
foreign fn termclear() Void;