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

Paul Hübner phubner at openjdk.org
Tue Oct 21 16:43:50 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.

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

Commit messages:
 - Remove unneccessary null terminator reservations.
 - Remove redundant null termination.

Changes: https://git.openjdk.org/jdk/pull/27920/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27920&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8365896
  Stats: 23 lines in 10 files changed: 1 ins; 9 del; 13 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 serviceability-dev mailing list