RFR: 8365896: Remove unnecessary explicit buffer nul-termination after using os::snprintf [v2]

Paul Hübner phubner at openjdk.org
Tue Oct 28 17:31:47 UTC 2025


> Hi all,
> 
> This PR removes some leftover null terminators and buffer reservations for null terminators, which have been made redundant with the new `snprintf` family of functions. 
> 
> In order to find these occurrences, I methodologically used multiple regular expressions over the entire codebase. I took a look at around 130 files in total, and updated where appropriate. 
> 
> I’ve tested this through tiers 1-5 on Linux (x64, AArch64), macOS (x64, AArch64) and Windows (x64). I’ve also successfully compiled for PowerPC and Zero on Linux.

Paul Hübner has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:

 - Merge branch 'master' into JDK-8365896
 - Remove unneccessary null terminator reservations.
 - Remove redundant null termination.

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/27920/files
  - new: https://git.openjdk.org/jdk/pull/27920/files/18bcd59f..57a7add0

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=27920&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27920&range=00-01

  Stats: 19877 lines in 459 files changed: 12334 ins; 4943 del; 2600 mod
  Patch: https://git.openjdk.org/jdk/pull/27920.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/27920/head:pull/27920

PR: https://git.openjdk.org/jdk/pull/27920


More information about the hotspot-dev mailing list