Use sizeof for custom sizes
This commit is contained in:
parent
17fb6344bd
commit
75480d3606
|
@ -324,7 +324,7 @@ main(int argc, char* argv[])
|
|||
LOG(LOG_WARN, "%s", "Received invalid IRC message (see RFC2812).");
|
||||
} else if (len == -1) {
|
||||
connection.info.state = CONN_RECONNECTING;
|
||||
} else if (buf.fifo.append_pos == 512) {
|
||||
} else if (buf.fifo.append_pos == sizeof(buf.fifo.buffer) - 1) {
|
||||
LOG(LOG_WARN, "%s. %s.", "FIFO buffer is full and no message could be parsed", "Discarding buffer");
|
||||
buf.fifo.append_pos = 0;
|
||||
*buf.fifo.buffer = '\0';
|
||||
|
@ -384,7 +384,7 @@ main(int argc, char* argv[])
|
|||
LOG(LOG_WARN, "%s", "Received invalid IRC message (see RFC2812).");
|
||||
} else if (len == -1) {
|
||||
connection.info.state = CONN_RECONNECTING;
|
||||
} else if (buf.recv.append_pos == 512) {
|
||||
} else if (buf.recv.append_pos == sizeof(buf.recv.fd) - 1) {
|
||||
LOG(LOG_WARN, "%s.", "Read buffer is full and no message could be parsed");
|
||||
connection.info.state = CONN_RECONNECTING;
|
||||
}
|
||||
|
|
Reference in New Issue