Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Oct 10, 2018
Merged

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

extensions/sdktools/vcaller.cpp Show resolved Hide resolved
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