Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • A ArduinoJson
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 24
    • Issues 24
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Benoît Blanchon
  • ArduinoJson
  • Merge requests
  • !105
An error occurred while fetching the assigned milestone of the selected merge_request.

Fixing issues with NULL ends

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge issues/101 into master 9 years ago
  • Overview 1
  • Commits 1
  • Pipelines 0
  • Changes 1

Created by: JeffAshton

Fix for Issue #101 (closed), Reading parsed numbers fails on esp8266

Compare
  • master (base)

and
  • latest version
    9519da40
    1 commit, 2 years ago

1 file
+ 8
- 3

    Preferences

    File browser
    Compare changes
src/JsonVariant.cpp
+ 8
- 3
  • View file @ 9519da40


@@ -32,8 +32,11 @@ double JsonVariant::as<double>() const {
if (_type == JSON_LONG || _type == JSON_BOOLEAN)
return static_cast<double>(_content.asLong);
if ((_type == JSON_STRING || _type == JSON_UNPARSED) && _content.asString)
return strtod(_content.asString, NULL);
if ((_type == JSON_STRING || _type == JSON_UNPARSED) && _content.asString) {
char* dummy;
return strtod(_content.asString, &dummy);
}
return 0.0;
}
@@ -47,7 +50,9 @@ long JsonVariant::as<long>() const {
if ((_type == JSON_STRING || _type == JSON_UNPARSED) && _content.asString) {
if (!strcmp("true", _content.asString)) return 1;
return strtol(_content.asString, NULL, 10);
char* dummy;
return strtol(_content.asString, &dummy, 10);
}
return 0L;
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
0
0 participants
Reference:
Source branch: issues/101

Menu

Explore Projects Groups Snippets