execve() fix for 6502
authorTormod Volden <debian.tormod@gmail.com>
Fri, 8 May 2015 20:29:49 +0000 (22:29 +0200)
committerAlan Cox <alan@linux.intel.com>
Sun, 10 May 2015 12:14:57 +0000 (13:14 +0100)
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Kernel/syscall_exec16.c

index 7792113..603c634 100644 (file)
@@ -218,8 +218,8 @@ arg_t _execve(void)
 
        // Shove argc and the address of argv just below envp
 #ifdef CONFIG_CALL_R2L /* Arguments are stacked the 'wrong' way around */
-       uputw((uint16_t) nargv, nenvp - 1);
-       uputw((uint16_t) argc, nenvp - 2);
+       uputw((uint16_t) nargv, nenvp - 2);
+       uputw((uint16_t) argc, nenvp - 1);
 #else
        uputw((uint16_t) nargv, nenvp - 1);
        uputw((uint16_t) argc, nenvp - 2);