Skip to content

Handle NULLs in SDKCall string return (Fixes #874)#906

Merged
asherkin merged 1 commit intomasterfrom
sdkcall-null
Oct 10, 2018
Merged

Handle NULLs in SDKCall string return (Fixes #874)#906
asherkin merged 1 commit intomasterfrom
sdkcall-null

Conversation

@asherkin
Copy link
Member

SDKCall has existing semantics that a -1 retval indicates null, so use that and write an empty string to the buffer.

Consumers can tell the difference between "" and NULL by checking if the return value is 0 or -1.

`SDKCall` has existing semantics that a `-1` retval indicates null, so use that and writes an empty string to the buffer.

Consumers can tell the difference between `""` and `NULL` by checking if the return value is `0` or `-1`.
@asherkin asherkin added the Bug general bugs; can be anything label Oct 10, 2018
@psychonic psychonic self-requested a review October 10, 2018 23:03
Copy link
Member

@Headline Headline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’d prefer to be explicit about casts and avoid c-style

Copy link
Member

@Headline Headline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@asherkin asherkin merged commit a1271ec into master Oct 10, 2018
asherkin added a commit that referenced this pull request Oct 10, 2018
`SDKCall` has existing semantics that a `-1` retval indicates null, so use that and writes an empty string to the buffer.

Consumers can tell the difference between `""` and `NULL` by checking if the return value is `0` or `-1`.
@asherkin asherkin deleted the sdkcall-null branch October 11, 2018 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug general bugs; can be anything

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants