Skip to content

Allow ATHandler::read_int to return 0 successfully #11248

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

Merged
merged 2 commits into from
Aug 29, 2019

Conversation

dextero
Copy link
Contributor

@dextero dextero commented Aug 16, 2019

Description

Currently, ATHandler::read_int is documented to return a positive integer on success, -1 on error. In cases where std::strtol fails to parse a value, 0 is returned - and it is impossible to determine whether that 0 means "parsing failed" or "parsed 0 successfully".

Most places in mbed-os that actually do error checking depend on 0 meaning success, e.g.:

This pull request updates ATHandler::read_int so that it only returns 0 on success, and updates the method comment appropriately.

Pull request type

[x] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

@ciarmcom ciarmcom requested review from a team August 16, 2019 13:00
@ciarmcom
Copy link
Member

@dextero, thank you for your changes.
@ARMmbed/mbed-os-wan @ARMmbed/mbed-os-maintainers please review.

@bulislaw
Copy link
Member

@AnttiKauppila please review

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 26, 2019

CI started

@mbed-ci
Copy link

mbed-ci commented Aug 27, 2019

Test run: FAILED

Summary: 1 of 11 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_greentea-test

@0xc0170 0xc0170 mentioned this pull request Aug 28, 2019
@0xc0170
Copy link
Contributor

0xc0170 commented Aug 28, 2019

This PR is part of rollup PR #11366

Please do not update this PR, or if needed, let us know asap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants