Skip to content

Conversation

@oldnewthing
Copy link
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
Collaborator

/azp run

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

@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
Collaborator

/azp run

@azure-pipelines
Copy link

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