Skip to content

Comments

Fix cctz::format()/parse() to treat NULs like any other chars#338

Open
devbww wants to merge 1 commit intogoogle:masterfrom
devbww:format-parse-and-NULs
Open

Fix cctz::format()/parse() to treat NULs like any other chars#338
devbww wants to merge 1 commit intogoogle:masterfrom
devbww:format-parse-and-NULs

Conversation

@devbww
Copy link
Contributor

@devbww devbww commented Feb 19, 2026

The previous commit (PR #337) was couched in terms of parse() rejecting input strings containing NULs. Instead, we should treat NULs like other characters by allowing them in both the format and input strings.

Similarly, format() should allow NULs in its format string.

Also:

  • Simplify FormatTM() calls by handling an empty format string internally, rather than by guarding each invocation.
  • Utilize the std::string iterator-pair constructor and append().

The previous commit (PR google#337) was couched in terms of `parse()`
rejecting input strings containing NULs.  Instead, we should
treat NULs like other characters by allowing them in both the
format and input strings.

Similarly, `format()` should allow NULs in its format string.

Also:
 - Simplify `FormatTM()` calls by handling an empty format
   string internally, rather than by guarding each invocation.
 - Utilize the `std::string` iterator-pair constructor and
   `append()`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant