Hi,
References: <[EMAIL PROTECTED]>
Content-Disposition: inline; filename=fix-compiler-warning-execve02.diff

Fix warning about _is_ unused variable (note the difference between "may" and 
"is" unused!).
Unintended mixup with *pwd and *path. *path never gets set.

execve02.c: In function 'setup':
execve02.c:217: warning: 'path' is used uninitialized in this function

Signed-off-by: Daniel Gollub <[EMAIL PROTECTED]>

---
 testcases/kernel/syscalls/execve/execve02.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: ltp-full-20080825/testcases/kernel/syscalls/execve/execve02.c
===================================================================
--- ltp-full-20080825.orig/testcases/kernel/syscalls/execve/execve02.c
+++ ltp-full-20080825/testcases/kernel/syscalls/execve/execve02.c
@@ -214,7 +214,7 @@ setup()
                if ((pwd = getcwd(NULL, 0)) == NULL) {
                        tst_brkm(TBROK, tst_exit, "Could not get current 
directory");
                }
-               path = malloc (strlen(path) + strlen(pwd) + 2);
+               path = malloc (strlen(pwd) + strlen(dname) +  2);
                if (path == NULL) {
                        tst_brkm(TBROK, tst_exit, "Cannot alloc path string");
                }


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to