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

Conversation

@asherkin
Copy link
Member

asherkin commented Oct 10, 2018

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 label Oct 10, 2018
@asherkin asherkin requested review from Drifter321 and Headline Oct 10, 2018
@psychonic psychonic self-requested a review Oct 10, 2018
Copy link
Member

Headline left a comment

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

extensions/sdktools/vcaller.cpp Show resolved Hide resolved
Copy link
Member

Headline left a comment

👍

@asherkin asherkin merged commit a1271ec into master Oct 10, 2018
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
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 Oct 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.