Skip to content

Fix concat_hstring for 0-length string#675

Merged
kennykerr merged 2 commits intomicrosoft:masterfrom
oldnewthing:0length
Jun 30, 2020
Merged

Fix concat_hstring for 0-length string#675
kennykerr merged 2 commits intomicrosoft:masterfrom
oldnewthing:0length

Conversation

@oldnewthing
Copy link
Copy Markdown
Member

@oldnewthing oldnewthing commented Jun 30, 2020

The zero-length string is represented by nullptr, not a heap-allocated string of length zero.

The zero-length string is represented by nullptr,
not a heap-allocated string of length zero.

Note that hstring_builder.data() must return a non-null
pointer because std::memcpy demands that the buffers be
non-null, even if the byte count is zero.
@kennykerr
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

No pipelines are associated with this pull request.

Comment thread strings/base_string.h Outdated
@oldnewthing oldnewthing changed the title Fix hstring_builder for 0-length string Fix concat_hstring for 0-length string Jun 30, 2020
@kennykerr
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

No pipelines are associated with this pull request.

@kennykerr kennykerr merged commit aeb78bb into microsoft:master Jun 30, 2020
@oldnewthing oldnewthing deleted the 0length branch July 8, 2020 16:56
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.

2 participants