Skip to contentSkip to conversation

ftest06.c: fix a bug of using option -i

PATCH In review Peng Haitao 2 participants 2 messages Mar 12, 2011 – Mar 16, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ftest06.c: fix a bug of using option -i

When using option -i, the case will print the following error message:

# ./ftest06 -i 2
ftest06     1  TPASS  :  Test passed.
ftest06     2  TFAIL  :         Can't chdir(/tmp/fteBX4U5O/ftest06.7461/tmp/fteBX4U5O/ftest06.7461): errno=ENOENT(2): No such file or directory
---
 testcases/kernel/fs/ftest/ftest06.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
testcases/kernel/fs/ftest/ftest06.c +2 -2
index 18eae5d..d59a18f 100644
@@ -140,10 +140,10 @@ int main(int ac, char *av[])
 			}
 		}
 		cwd = startdir;
-		strcat(dirname, cwd);
+		strcpy(dirname, cwd);
 		sprintf(tmpname, "/ftest06.%d", getpid());
 		strcat(dirname, tmpname);
-		strcat(homedir, cwd);
+		strcpy(homedir, cwd);
 		sprintf(tmpname, "/ftest06h.%d", getpid());
 		strcat(homedir, tmpname);
 
Signature · 16 lines
1.7.1

-- 
Best Regards,
Peng Haitao


------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#1 lore raw

Hi!

Quoted 5 lines

When using option -i, the case will print the following error message:

# ./ftest06 -i 2
ftest06     1  TPASS  :  Test passed.
ftest06     2  TFAIL  :         Can't chdir(/tmp/fteBX4U5O/ftest06.7461/tmp/fteBX4U5O/ftest06.7461): errno=ENOENT(2): No such file or directory

I've commited a little different patch that replaces the the strcat()'s and strcpy()'s with single snprintf().

Thanks!

Signature · 12 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list