forked from bblanchon/ArduinoJson
Make JSON_STRING_SIZE(N) return N+1 to fix third-party code
ThingsBoard uses this macro to compute size of char arrays ಠ_ಠ https://github.com/thingsboard/thingsboard-client-sdk/blob/v0.12.2/src/Helper.h#L38 Closes #2054
This commit is contained in:
@@ -39,7 +39,7 @@
|
||||
#define JSON_OBJECT_SIZE(N) _Pragma ("GCC warning \"JSON_OBJECT_SIZE is deprecated, you don't need to compute the size anymore\"") (ArduinoJson::detail::sizeofObject(N))
|
||||
|
||||
// DEPRECATED: you don't need to compute the size anymore
|
||||
#define JSON_STRING_SIZE(N) _Pragma ("GCC warning \"JSON_STRING_SIZE is deprecated, you don't need to compute the size anymore\"") (ArduinoJson::detail::sizeofString(N))
|
||||
#define JSON_STRING_SIZE(N) _Pragma ("GCC warning \"JSON_STRING_SIZE is deprecated, you don't need to compute the size anymore\"") (N+1)
|
||||
|
||||
#else
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
#define JSON_OBJECT_SIZE(N) (ArduinoJson::detail::sizeofObject(N))
|
||||
|
||||
// DEPRECATED: you don't need to compute the size anymore
|
||||
#define JSON_STRING_SIZE(N) (ArduinoJson::detail::sizeofString(N))
|
||||
#define JSON_STRING_SIZE(N) (N+1)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user