mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-18 10:59:45 +00:00
update examples
This commit is contained in:
1 parent
074ef5197b
commit
f5e2c68c8b
27 files changed
+166
-47
No files matched your search
@@ -156,10 +156,10 @@ static void handle_settings_set(struct mg_connection *c, struct mg_str body) {
|
||||
settings.log_level = (int) mg_json_get_long(body, "$.log_level", 0);
|
||||
settings.brightness = mg_json_get_long(body, "$.brightness", 0);
|
||||
if (s && strlen(s) < MAX_DEVICE_NAME) {
|
||||
free(settings.device_name);
|
||||
mg_free(settings.device_name);
|
||||
settings.device_name = s;
|
||||
} else {
|
||||
free(s);
|
||||
mg_free(s);
|
||||
}
|
||||
s_settings = settings; // Save to the device flash
|
||||
mg_http_reply(c, 200, s_json_header,
|
||||
|
||||
Reference in new issue
Block a user