diff options
Diffstat (limited to 'userspace/foolshell.c')
| -rw-r--r-- | userspace/foolshell.c | 16 |
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++; |
