mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8076475: Misuses of strncpy/strncat
Various small fixes around strncpy and strncat Reviewed-by: dsamersoff, coleenp
This commit is contained in:
parent
137a04308f
commit
c034b74806
12 changed files with 56 additions and 52 deletions
|
@ -463,14 +463,7 @@ void VMError::report(outputStream* st) {
|
|||
#else
|
||||
const char *file = _filename;
|
||||
#endif
|
||||
size_t len = strlen(file);
|
||||
size_t buflen = sizeof(buf);
|
||||
|
||||
strncpy(buf, file, buflen);
|
||||
if (len + 10 < buflen) {
|
||||
sprintf(buf + len, ":%d", _lineno);
|
||||
}
|
||||
st->print(" (%s)", buf);
|
||||
st->print(" (%s:%d)", file, _lineno);
|
||||
} else {
|
||||
st->print(" (0x%x)", _id);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue