BUG: Fixed off-by-one error in test6 function.

This commit is contained in:
Brad King 2004-07-13 17:33:23 -04:00
parent 0437b776b6
commit b993cd7fba
1 changed files with 2 additions and 3 deletions

View File

@ -96,19 +96,18 @@ int test5(int argc, const char* argv[])
int test6(int argc, const char* argv[]) int test6(int argc, const char* argv[])
{ {
int i; int i;
char runaway[TEST6_SIZE+2]; char runaway[TEST6_SIZE+1];
(void)argc; (void)argv; (void)argc; (void)argv;
for(i=0;i < TEST6_SIZE;++i) for(i=0;i < TEST6_SIZE;++i)
{ {
runaway[i] = '.'; runaway[i] = '.';
} }
runaway[TEST6_SIZE] = '\n'; runaway[TEST6_SIZE] = '\n';
runaway[TEST6_SIZE] = 0;
/* Generate huge amounts of output to test killing. */ /* Generate huge amounts of output to test killing. */
for(;;) for(;;)
{ {
fwrite(runaway, 1, TEST6_SIZE+2, stdout); fwrite(runaway, 1, TEST6_SIZE+1, stdout);
fflush(stdout); fflush(stdout);
} }
return 0; return 0;