src/hotspot/share/prims/jvm.cpp
changeset 49842 8c1a4628b2f0
parent 49786 7444101401b2
child 50039 9fec54fe663d
--- a/src/hotspot/share/prims/jvm.cpp	Thu Apr 19 17:43:26 2018 +0200
+++ b/src/hotspot/share/prims/jvm.cpp	Tue Apr 17 15:54:14 2018 +0200
@@ -2768,15 +2768,14 @@
   return len;
 }
 
-
 // HotSpot specific jio method
-void jio_print(const char* s) {
+void jio_print(const char* s, size_t len) {
   // Try to make this function as atomic as possible.
   if (Arguments::vfprintf_hook() != NULL) {
-    jio_fprintf(defaultStream::output_stream(), "%s", s);
+    jio_fprintf(defaultStream::output_stream(), "%.*s", (int)len, s);
   } else {
     // Make an unused local variable to avoid warning from gcc 4.x compiler.
-    size_t count = ::write(defaultStream::output_fd(), s, (int)strlen(s));
+    size_t count = ::write(defaultStream::output_fd(), s, (int)len);
   }
 }