Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8365896

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

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 26
    • hotspot
    • None

      Historically snprintf did not guarantee nul-termination in case of truncation so we have code like:

      snprintf(buf, sizeof(buf), "%s", name);
      buf[sizeof(buf) - 1] = '\0';

      but this explicit nul-termination is no longer necessary.

            Unassigned Unassigned
            dholmes David Holmes
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: