changeset 2650:1dd9b3d73b22

Added fix for bug id #7073913.
author ptisnovs
date Wed, 03 Aug 2011 10:25:33 +0200
parents 02ee527cc0ae
children 0d7ef4460bc2
files src/share/vm/runtime/os.cpp
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/runtime/os.cpp	Fri Jul 29 09:16:29 2011 -0700
+++ b/src/share/vm/runtime/os.cpp	Wed Aug 03 10:25:33 2011 +0200
@@ -1298,7 +1298,7 @@
   size_t sz, i = 0;
 
   // read until EOF, EOL or buf is full
-  while ((sz = (int) read(fd, &buf[i], 1)) == 1 && i < (bsize-1) && buf[i] != '\n') {
+  while ((sz = (int) read(fd, &buf[i], 1)) == 1 && i < (bsize-2) && buf[i] != '\n') {
      ++i;
   }
 
@@ -1319,7 +1319,7 @@
   }
 
   // line is longer than size of buf, skip to EOL
-  int ch;
+  char ch;
   while (read(fd, &ch, 1) == 1 && ch != '\n') {
     // Do nothing
   }