diff --git a/ESPFirewall/lib/Firewall/src/Storage.cpp b/ESPFirewall/lib/Firewall/src/Storage.cpp index b2f366f..4504ae4 100644 --- a/ESPFirewall/lib/Firewall/src/Storage.cpp +++ b/ESPFirewall/lib/Firewall/src/Storage.cpp @@ -65,8 +65,8 @@ namespace fw this->memory.begin(rulename, true); strncpy(rule_ptr->ip, this->memory.getString(firewall_fields[IP], "0.0.0.0").c_str(), sizeof(rule_ptr->ip)); - rule_ptr->port_from = this->memory.getUChar(firewall_fields[PORT_FROM], 0); - rule_ptr->port_to = this->memory.getUChar(firewall_fields[PORT_TO], 0); + rule_ptr->port_from = this->memory.getULong(firewall_fields[PORT_FROM], 0); + rule_ptr->port_to = this->memory.getULong(firewall_fields[PORT_TO], 0); rule_ptr->protocol = static_cast(this->memory.getUChar(firewall_fields[PROTOCOL], PROTOCOL_ALL)); rule_ptr->target = static_cast(this->memory.getUChar(firewall_fields[TARGET], TARGET_REJECT)); this->memory.end(); @@ -103,8 +103,8 @@ namespace fw this->memory.begin(rulename, false); this->memory.putString(firewall_fields[IP], rule_ptr->ip); - this->memory.putUChar(firewall_fields[PORT_FROM], rule_ptr->port_from); - this->memory.putUChar(firewall_fields[PORT_TO], rule_ptr->port_to); + this->memory.putULong(firewall_fields[PORT_FROM], rule_ptr->port_from); + this->memory.putULong(firewall_fields[PORT_TO], rule_ptr->port_to); this->memory.putUChar(firewall_fields[PROTOCOL], rule_ptr->protocol); this->memory.putUChar(firewall_fields[TARGET], rule_ptr->target);