Own fork of MbedSmartRest
Dependents: MbedSmartRestMain MbedSmartRestMain
Fork of MbedSmartRest by
Diff: CharValue.cpp
- Revision:
- 19:81dfc04ce0bb
- Parent:
- 11:e1bee9a77652
--- a/CharValue.cpp Fri Mar 06 10:37:09 2015 +0000 +++ b/CharValue.cpp Fri Mar 20 14:26:52 2015 +0000 @@ -143,11 +143,10 @@ /*-------------------------------------------------------------------------*/ bool CharValue::escapeCheck() { - const char *ptr; char c; + const char *ptr = _str; + char c = '\0'; - ptr = _str; - while (*ptr != '\0') - { + while (*ptr != '\0') { c = *ptr; if ((isspace(c)) && ((ptr == _str) || (c != ' '))) return true; @@ -155,10 +154,9 @@ return true; ptr++; } - if (isspace(c)) return true; - - return false; + else + return false; } /*-------------------------------------------------------------------------*/