summaryrefslogtreecommitdiff
path: root/userspace/foolshell.c
diff options
context:
space:
mode:
authorMichal Idziorek <m.i@gmx.at>2015-05-24 23:30:12 +0200
committerMichal Idziorek <m.i@gmx.at>2015-05-24 23:30:12 +0200
commit8ea3e244d44190e44a092ffb004e13ad94174c68 (patch)
tree2365b0ec35b4fbdc82d49bcefc014fc8af59b251 /userspace/foolshell.c
parent1b64f1e69bfbffc0e70ba3a1baff00ed3fd8cb51 (diff)
porting ncurses...
Diffstat (limited to 'userspace/foolshell.c')
-rw-r--r--userspace/foolshell.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/userspace/foolshell.c b/userspace/foolshell.c
index 0ec7e88..fa62094 100644
--- a/userspace/foolshell.c
+++ b/userspace/foolshell.c
@@ -3,7 +3,17 @@
#include <stdbool.h>
#include <string.h>
+#include <reent.h>
+
extern char **environ;
+extern struct _reent *_impure_ptr;
+
+
+
+uint8_t buf_test[1024*300];
+
+
+
//
void hello()
@@ -50,6 +60,7 @@ void prompt()
int main(int argc, char **argv)
{
/*
+ printf("_impure_ptr: 0x%08x\n",_impure_ptr);
printf("argv= 0x%08x \n",argv);
printf("environ= 0x%08x \n",environ);
*/
@@ -62,7 +73,8 @@ int main(int argc, char **argv)
if(!silent)hello();
- char *buf=malloc(256);
+ //char *buf=malloc(256);
+ char buf[256];
while(1)
{
@@ -89,7 +101,7 @@ char **tokenize(char *buf)
for(i=0;i<l;i++)
{
// init space for next token
- token[c]=malloc(256);
+ token[c]=calloc(sizeof(char),256);
//skip all the whitespace
while(buf[i]==' '&&i<l)i++;