Skip to content
Snippets Groups Projects
Commit c8e0ad84 authored by Deon George's avatar Deon George
Browse files

Consistent use of NULL, read_socket_line() no longer considers a NULL terminated string as good

parent 318624da
No related branches found
No related tags found
2 merge requests!463MRC mods by Codefenix (2024-10-20),!11Enable obtaining source IP address if HAproxy is used
...@@ -301,9 +301,9 @@ static BOOL read_socket_line(SOCKET sock, char *buffer, size_t buflen, int (*lpr ...@@ -301,9 +301,9 @@ static BOOL read_socket_line(SOCKET sock, char *buffer, size_t buflen, int (*lpr
if (read_socket(sock, &buffer[i], 1, lprintf)) { if (read_socket(sock, &buffer[i], 1, lprintf)) {
switch(buffer[i]) { switch(buffer[i]) {
case 0: case 0:
return TRUE; return FALSE;
case '\n': case '\n':
buffer[i+1] = '\0'; buffer[i+1] = 0;
return TRUE; return TRUE;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment