8148005: One byte may be corrupted by get_datetime_string()

Reviewed-by: dholmes
This commit is contained in:
Artem Smotrakov 2016-02-04 13:42:18 -08:00
parent 88711a6b2d
commit 395a248587

@ -380,7 +380,7 @@ extern Mutex* tty_lock;
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] = '-';
}