diff options
author | Alexey Dokuchaev <danfe@FreeBSD.org> | 2018-02-04 09:44:23 +0000 |
---|---|---|
committer | Alexey Dokuchaev <danfe@FreeBSD.org> | 2018-02-04 09:44:23 +0000 |
commit | 5bb1e00e7c7ad131f285249c177e48271a3c9782 (patch) | |
tree | ddb15848414ccf94cd376626013d67604c19e821 /sysutils/apachetop/files/patch-src_log.cc | |
parent | Patches to make the code compatible with clang-6.0 / C++17 -- this will (diff) |
- Fix some sloppy coding that was upsetting new Clang
- Switch MASTER_SITES to https:// and add LICENSE
PR: 225649 (modified)
Submitted by: maintainer
Notes
Notes:
svn path=/head/; revision=460880
Diffstat (limited to 'sysutils/apachetop/files/patch-src_log.cc')
-rw-r--r-- | sysutils/apachetop/files/patch-src_log.cc | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/sysutils/apachetop/files/patch-src_log.cc b/sysutils/apachetop/files/patch-src_log.cc new file mode 100644 index 000000000000..37a984b25c7c --- /dev/null +++ b/sysutils/apachetop/files/patch-src_log.cc @@ -0,0 +1,56 @@ +--- 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'; + } + + |