8167423: Adding return value check and updating index variable

Reviewed-by: dholmes, coleenp
This commit is contained in:
Shafi Ahmad 2017-02-16 00:50:19 -08:00
parent f404ded34f
commit 0a19790e65

View file

@ -719,6 +719,8 @@ void JDK_Version::to_string(char* buffer, size_t buflen) const {
index += rc;
if (_security > 0) {
rc = jio_snprintf(&buffer[index], buflen - index, ".%d", _security);
if (rc == -1) return;
index += rc;
}
if (_patch > 0) {
rc = jio_snprintf(&buffer[index], buflen - index, ".%d", _patch);