We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e197696 + 3195d23 commit 33363f7Copy full SHA for 33363f7
src/FirebaseArduino.cpp
@@ -179,7 +179,13 @@ FirebaseObject FirebaseArduino::readEvent() {
179
String event = client->readStringUntil('\n').substring(6);
180
client->readStringUntil('\n'); // consume separator
181
FirebaseObject obj = FirebaseObject(event.c_str());
182
- obj.getJsonVariant().asObject()["type"] = type.c_str();
+
183
+ // required to have a copy of the string but use a char[] format which is
184
+ // the only supported format for JsonObject#set (it does not like the std::string of the test env)
185
+ char *cstr = new char[type.length() + 1];
186
+ strncpy(cstr, type.c_str(), type.length() + 1);
187
+ obj.getJsonVariant().as<JsonObject&>().set("type", cstr);
188
+ delete[] cstr;
189
return obj;
190
}
191
0 commit comments