opnsense-ports/sysutils/apachetop/files/patch-src_log.cc
Franco Fichtner 9f1182f5f5 */*: sync with upstream
Taken from: HardenedBSD
2018-02-04 12:49:34 +01:00

56 lines
1.5 KiB
C++

--- src/log.cc.orig 2018-02-04 09:36:17 UTC
+++ src/log.cc
@@ -37,7 +37,7 @@ int CommonLogParser::parse(char *logline, struct logbi
if (!bufcp)
return -1;
- *bufcp = (char) NULL;
+ *bufcp = '\0';
++bufcp;
/* quickly figure out if this is an IP or a host. We do this by
@@ -172,7 +172,7 @@ int CommonLogParser::parse(char *logline, struct logbi
/* find the end of referrer and null it */
if (!(bufcp = strchr(bufsp, '"')))
return -1;
- *bufcp = (char) NULL;
+ *bufcp = '\0';
/* unless they want to keep it, skip over the protocol, ie http:// */
if ((cf.preserve_ref_protocol == 0) && (bufcp = strstr(bufsp, "://")))
@@ -230,7 +230,7 @@ char *LogParser::processURL(char **buf) /* {{{ */
return NULL;
/* null the space in front of it */
- *endptr = (char) NULL;
+ *endptr = '\0';
/* TODO maybe we can use the protocol someday.. */
@@ -258,7 +258,7 @@ int LogParser::mungeURL(char **url, int *length) /* {{
char *bufcp, *endptr, *workptr;
endptr = *url + *length;
- *endptr = (char) NULL;
+ *endptr = '\0';
/* do we want to keep the query string? */
if (!cf.keep_querystring)
@@ -273,7 +273,7 @@ int LogParser::mungeURL(char **url, int *length) /* {{
if (workptr < endptr)
{
/* we're ok */
- *workptr = (char) NULL;
+ *workptr = '\0';
bufcp = workptr+1;
}
}
@@ -308,7 +308,7 @@ int LogParser::mungeURL(char **url, int *length) /* {{
if (workptr == endptr)
bufcp = workptr;
}
- *bufcp = (char) NULL;
+ *bufcp = '\0';
}