Merge pull request #5642 from tonhuisman/bugfix/Command-udpport-argument-parsing

[Commands] UdpPort argument processing fix
This commit is contained in:
TD-er authored and GitHub committed 2026-10-07 21:54:56 +02:00
commit 06b2d3a037
3 files changed
+14 -15

No files matched your search

+5 -6
View File
@@ -213,10 +213,10 @@ String Command_GetORSetETH(struct EventStruct *event,
}
#endif
String Command_GetORSetInt8_t(struct EventStruct *event,
String Command_GetORSetUInt32_t(struct EventStruct *event,
const __FlashStringHelper * targetDescription,
const char *Line,
int8_t *value,
uint32_t *value,
int arg)
{
bool hasArgument = false;
@@ -226,11 +226,10 @@ String Command_GetORSetInt8_t(struct EventStruct *event,
if (GetArgv(Line, TmpStr1, arg + 1)) {
hasArgument = true;
TmpStr1.toLowerCase();
int32_t tmp_int = 0;
if (validIntFromString(TmpStr1, tmp_int)) {
*value = static_cast<int8_t>(tmp_int);
uint32_t tmp_int{};
if (validUIntFromString(TmpStr1, tmp_int)) {
*value = tmp_int;
}
}
}
+5 -5
View File
@@ -62,11 +62,11 @@ String Command_GetORSetETH(struct EventStruct *event,
int arg);
#endif
String Command_GetORSetInt8_t(struct EventStruct *event,
const __FlashStringHelper * targetDescription,
const char *Line,
int8_t *value,
int arg);
String Command_GetORSetUInt32_t(struct EventStruct *event,
const __FlashStringHelper * targetDescription,
const char *Line,
uint32_t *value,
int arg);
String Command_GetORSetFloatMinMax(struct EventStruct *event,
const __FlashStringHelper * targetDescription,
+4 -4
View File
@@ -11,10 +11,10 @@
String Command_UDP_Port(struct EventStruct *event, const char *Line)
{
return Command_GetORSetBool(event, F("UDPPort:"),
Line,
(bool *)&Settings.UDPPort,
1);
return Command_GetORSetUInt32_t(event, F("UDPPort:"),
Line,
&Settings.UDPPort,
1);
}
#if FEATURE_ESPEASY_P2P