aboutsummaryrefslogtreecommitdiff
path: root/std/stdlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'std/stdlib.c')
-rw-r--r--std/stdlib.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/std/stdlib.c b/std/stdlib.c
index dcb7ec3..3878817 100644
--- a/std/stdlib.c
+++ b/std/stdlib.c
@@ -2,6 +2,7 @@
#include <stdlib.h>
#include <string.h>
#include <time.h>
+#include <stdio.h>
int wait(int msec) {
struct timespec ts;
@@ -39,7 +40,9 @@ int as_int(float x) {
return (int) x;
}
-// char* istr(int x) {
-// char snum[100];
-// return (char* )itoa(x, snum, 10);
-// }
+char* istr(int x) {
+ char* snum[100];
+ sprintf(snum, "%d", x);
+ //char* result = snum;
+ return snum;
+}