forked from bblanchon/ArduinoJson
Fixed parser that incorrectly rejected floats containing a +
(issue #349)
This commit is contained in:
@ -50,7 +50,7 @@ class JsonParser {
|
||||
|
||||
static inline bool isLetterOrNumber(char c) {
|
||||
return isInRange(c, '0', '9') || isInRange(c, 'a', 'z') ||
|
||||
isInRange(c, 'A', 'Z') || c == '-' || c == '.';
|
||||
isInRange(c, 'A', 'Z') || c == '+' || c == '-' || c == '.';
|
||||
}
|
||||
|
||||
static inline bool isQuote(char c) {
|
||||
|
@ -17,14 +17,14 @@ template <>
|
||||
inline bool JsonObject::setNodeValue(node_type *node, String &value) {
|
||||
const char *dup = _buffer->strdup(value);
|
||||
node->content.value = dup;
|
||||
return dup;
|
||||
return dup != NULL;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline bool JsonObject::setNodeValue(node_type *node, const String &value) {
|
||||
const char *dup = _buffer->strdup(value);
|
||||
node->content.value = dup;
|
||||
return dup;
|
||||
return dup != NULL;
|
||||
}
|
||||
|
||||
template <>
|
||||
|
@ -23,7 +23,7 @@ class Print {
|
||||
size_t print(const char* s) {
|
||||
size_t n = 0;
|
||||
while (*s) {
|
||||
n += write(*s++);
|
||||
n += write(static_cast<uint8_t>(*s++));
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
Reference in New Issue
Block a user