Skip to content

Commit ba34aa7

Browse files
committed
avoid comparing uninitialized padding per review
1 parent b57fd66 commit ba34aa7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

libraries/ESP8266WebServer/src/ESP8266WebServer-impl.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,12 @@ void ESP8266WebServerTemplate<ServerType>::handleClient() {
303303
uint8_t connected;
304304
int available;
305305
HTTPClientStatus status;
306-
bool operator != (const compare_s& o) { return memcmp(this, &o, sizeof(o)) != 0; }
306+
bool operator != (const compare_s& o)
307+
{
308+
return o.connected != connected
309+
|| o.available != available
310+
|| o.status != status;
311+
}
307312
};
308313
static compare_s last { false, 0, HC_NONE };
309314
compare_s now { _currentClient.connected(), _currentClient.available(), _currentStatus };

0 commit comments

Comments
 (0)