mirror of https://github.com/arendst/Tasmota.git
Merge pull request #8359 from s-hadinger/minor_size_opt
Minor size optimizations
This commit is contained in:
commit
77177392dc
|
@ -87,10 +87,7 @@ void ResponseCmndIdxNumber(int value)
|
|||
|
||||
void ResponseCmndChar_P(const char* value)
|
||||
{
|
||||
size_t buf_size = strlen_P(value);
|
||||
char buf[buf_size + 1];
|
||||
strcpy_P(buf, value);
|
||||
Response_P(S_JSON_COMMAND_SVALUE, XdrvMailbox.command, buf);
|
||||
Response_P(S_JSON_COMMAND_SVALUE, XdrvMailbox.command, value);
|
||||
}
|
||||
|
||||
void ResponseCmndChar(const char* value)
|
||||
|
|
|
@ -844,9 +844,7 @@ void WSContentStart_P(const char* title, bool auth)
|
|||
WSContentBegin(200, CT_HTML);
|
||||
|
||||
if (title != nullptr) {
|
||||
char ctitle[strlen_P(title) +1];
|
||||
strcpy_P(ctitle, title); // Get title from flash to RAM
|
||||
WSContentSend_P(HTTP_HEADER1, SettingsText(SET_FRIENDLYNAME1), ctitle);
|
||||
WSContentSend_P(HTTP_HEADER1, SettingsText(SET_FRIENDLYNAME1), title);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -626,10 +626,8 @@ void ZigbeeStateMachine_Run(void) {
|
|||
case ZGB_INSTR_MQTT_STATE:
|
||||
{
|
||||
const char *f_msg = (const char*) cur_ptr1;
|
||||
char buf[strlen_P(f_msg) + 1];
|
||||
strcpy_P(buf, f_msg);
|
||||
Response_P(PSTR("{\"" D_JSON_ZIGBEE_STATE "\":{\"Status\":%d,\"Message\":\"%s\"}}"),
|
||||
cur_d8, buf);
|
||||
cur_d8, f_msg);
|
||||
MqttPublishPrefixTopic_P(RESULT_OR_TELE, PSTR(D_JSON_ZIGBEE_STATE));
|
||||
XdrvRulesProcess();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue