mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 02:54:35 +02:00
8062370: Various minor code improvements
A lot of fixes useful to improve the code quality. Reviewed-by: coleenp, dholmes
This commit is contained in:
parent
f048251de8
commit
0aa09022fa
35 changed files with 141 additions and 64 deletions
|
@ -2583,7 +2583,14 @@ ATTRIBUTE_PRINTF(3, 0)
|
|||
int jio_vsnprintf(char *str, size_t count, const char *fmt, va_list args) {
|
||||
// see bug 4399518, 4417214
|
||||
if ((intptr_t)count <= 0) return -1;
|
||||
return vsnprintf(str, count, fmt, args);
|
||||
|
||||
int result = vsnprintf(str, count, fmt, args);
|
||||
if ((result > 0 && (size_t)result >= count) || result == -1) {
|
||||
str[count - 1] = '\0';
|
||||
result = -1;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
ATTRIBUTE_PRINTF(3, 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue