8148005: One byte may be corrupted by get_datetime_string()
authorasmotrak
Thu, 04 Feb 2016 13:42:18 -0800
changeset 35936 e401b754ae09
parent 35935 a2bae85710af
child 35938 a734965f7634
8148005: One byte may be corrupted by get_datetime_string() Reviewed-by: dholmes
hotspot/src/share/vm/utilities/ostream.cpp
--- a/hotspot/src/share/vm/utilities/ostream.cpp	Thu Feb 04 19:27:39 2016 +0100
+++ b/hotspot/src/share/vm/utilities/ostream.cpp	Thu Feb 04 13:42:18 2016 -0800
@@ -380,7 +380,7 @@
 char* get_datetime_string(char *buf, size_t len) {
   os::local_time_string(buf, len);
   int i = (int)strlen(buf);
-  while (i-- >= 0) {
+  while (--i >= 0) {
     if (buf[i] == ' ') buf[i] = '_';
     else if (buf[i] == ':') buf[i] = '-';
   }