From 369c62119b9dd60db77fc28e8857ed9c4d498889 Mon Sep 17 00:00:00 2001 From: Michal Idziorek Date: Mon, 24 Nov 2014 01:54:47 +0100 Subject: problems with ENV --- userspace/simple.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'userspace/simple.c') diff --git a/userspace/simple.c b/userspace/simple.c index bd42d9c..e84b072 100644 --- a/userspace/simple.c +++ b/userspace/simple.c @@ -1,15 +1,14 @@ #include extern char **environ; + int main(int argc, char **argv) { printf("argv: 0x%08X\n",argv); - printf("env: 0x%08X\n",environ); - - putenv("test=11"); + printf("env: 0x%08X\n",environ); int i=0; while(environ[i]!=NULL) @@ -18,7 +17,15 @@ int main(int argc, char **argv) i++; } - puts("bye"); + putenv("supa=dupa"); + printf("env: 0x%08X\n",environ); + + i=0; + while(environ[i]!=NULL) + { + printf("envvar %s (0x%08X)\n" ,environ[i],environ[i]); + i++; + } return 0; } -- cgit v1.2.3