Browse Source

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

Brad King 21 years ago
parent
commit
b993cd7fba
1 changed files with 2 additions and 3 deletions
  1. 2 3
      Source/kwsys/testProcess.c

+ 2 - 3
Source/kwsys/testProcess.c

@@ -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;