diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/os_ignore.c | 7 | ||||
-rw-r--r-- | src/modules/hs_request.c | 14 |
2 files changed, 6 insertions, 15 deletions
diff --git a/src/core/os_ignore.c b/src/core/os_ignore.c index e7bb27a52..1db367d9d 100644 --- a/src/core/os_ignore.c +++ b/src/core/os_ignore.c @@ -195,10 +195,9 @@ class OSIgnore : public Module } else { - std::string buf = "OS IGNORE "; - buf += ign->mask; - buf += " " + ign->time; - Write(buf); + std::stringstream buf; + buf << "OS IGNORE " << ign->mask << " " << ign->time; + Write(buf.str()); } } } diff --git a/src/modules/hs_request.c b/src/modules/hs_request.c index 70be073ec..3973f6006 100644 --- a/src/modules/hs_request.c +++ b/src/modules/hs_request.c @@ -714,17 +714,9 @@ class HSRequest : public Module for (std::map<std::string, HostRequest *>::iterator it = Requests.begin(); it != Requests.end(); ++it) { HostRequest *hr = it->second; - std::string buf = "HS_REQUEST "; - buf += it->first; - buf += " "; - buf += hr->ident.empty() ? "(null)" : hr->ident; - buf += " "; - buf += hr->host; - buf += " "; - char tsbuf[16]; - snprintf(tsbuf, sizeof(tsbuf), "%ld", hr->time); - buf += tsbuf; - Write(buf); + std::stringstream buf; + buf << "HS_REQUEST " << it->first << " " << (hr->ident.empty() ? "(null)" : hr->ident) << " " << hr->host << " " << hr->time; + Write(buf.str()); } } }; |