From 66637886123d27aa6e636d703a9d3755598a3520 Mon Sep 17 00:00:00 2001 From: orignal Date: Fri, 22 Jan 2016 07:08:21 -0500 Subject: [PATCH] fixed some coding style --- HTTPProxy.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/HTTPProxy.cpp b/HTTPProxy.cpp index 17b8e816..fcb8674a 100644 --- a/HTTPProxy.cpp +++ b/HTTPProxy.cpp @@ -185,13 +185,16 @@ namespace proxy assert(len); // This should always be called with a least a byte left to parse // remove "Referer" from http requst - http_buff[len] = '\0'; - char *start = strstr((char *)http_buff, "\nReferer:"); - if (start!=0) + http_buff[len] = 0; + auto start = strstr((char *)http_buff, "\nReferer:"); + if (start) { - char *end = strstr(start+1, "\n"); - strncpy(start, end, (char*)(http_buff + len) - end); - len = len - (end - start); + auto end = strchr (start + 1, '\n'); + if (end) + { + strncpy(start, end, (char *)(http_buff + len) - end); + len -= (end - start); + } } while (len > 0)