1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-29 16:42:19 +01:00

Force braces around multi-line statements (#3094)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
Oxan van Leeuwen
2022-01-24 20:56:36 +01:00
committed by GitHub
parent 6b27f2d2cf
commit 80d03a631e
125 changed files with 770 additions and 504 deletions

View File

@@ -88,9 +88,10 @@ class BSDSocketImpl : public Socket {
for (int i = 0; i < iovcnt; i++) {
ssize_t err = this->read(reinterpret_cast<uint8_t *>(iov[i].iov_base), iov[i].iov_len);
if (err == -1) {
if (ret != 0)
if (ret != 0) {
// if we already read some don't return an error
break;
}
return err;
}
ret += err;
@@ -115,9 +116,10 @@ class BSDSocketImpl : public Socket {
ssize_t err =
this->send(reinterpret_cast<uint8_t *>(iov[i].iov_base), iov[i].iov_len, i == iovcnt - 1 ? 0 : MSG_MORE);
if (err == -1) {
if (ret != 0)
if (ret != 0) {
// if we already wrote some don't return an error
break;
}
return err;
}
ret += err;