summaryrefslogtreecommitdiffhomepage
path: root/http.c
diff options
context:
space:
mode:
Diffstat (limited to 'http.c')
-rw-r--r--http.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/http.c b/http.c
index ca7dcdf..5e1472c 100644
--- a/http.c
+++ b/http.c
@@ -173,20 +173,20 @@ static int read_until_word(struct request * request)
/// \return Position of the first byte of the separator or 0 if line separator could not be found
static int read_rest_of_line(struct request * request)
{
- char buffer[2] = {0, 0};
while (request->position < request->length - 1)
{
- memcpy(buffer, &request->data[request->position], 2);
- if (0 == strncmp(buffer, "\r\n", 2))
+ if ('\r' == request->data[request->position] && '\n' == request->data[request->position + 1])
{
return request->position;
}
- if (buffer[1] == '\r')
+ else if ('\r' == request->data[request->position + 1])
{
request->position += 1;
- continue;
}
- request->position += 2;
+ else
+ {
+ request->position += 2;
+ }
}
return 0;
}