< prev index next >

src/share/vm/compiler/compileLog.cpp

Print this page
rev 10979 : 8140594: Various minor code improvements (compiler)

@@ -229,11 +229,12 @@
       }
 
       // Copy any remaining data inside a quote:
       bool saw_slop = false;
       int end_cdata = 0;  // state machine [0..2] watching for too many "]]"
-      while ((nr = read(partial_fd, buf, buflen)) > 0) {
+      while ((nr = read(partial_fd, buf, buflen-1)) > 0) {
+        buf[buflen-1] = '\0';
         if (!saw_slop) {
           file->print_raw_cr("<fragment>");
           file->print_raw_cr("<![CDATA[");
           saw_slop = true;
         }
< prev index next >