aboutsummaryrefslogtreecommitdiffstats
path: root/vespalog
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2019-05-09 08:48:34 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2019-05-09 08:48:34 +0000
commitc63a5c20f633f1b0fe2703baac1f20b007ece387 (patch)
tree75f3335e7eee6ec560ed3de8789d39157bab4541 /vespalog
parentc3667718a63a8703bf62833dcb92b7ad5422d0cc (diff)
Modernize so gcc 9 does not complain.
Diffstat (limited to 'vespalog')
-rw-r--r--vespalog/src/logctl/logctl.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/vespalog/src/logctl/logctl.cpp b/vespalog/src/logctl/logctl.cpp
index a0963b43c34..743847a1237 100644
--- a/vespalog/src/logctl/logctl.cpp
+++ b/vespalog/src/logctl/logctl.cpp
@@ -139,7 +139,7 @@ main(int argc, char **argv)
char buf[PATH_MAX];
if (!dir && !file) {
- snprintf(buf, sizeof buf, "%s/var/db/vespa/logcontrol", root);
+ snprintf(buf, sizeof(buf), "%s/var/db/vespa/logcontrol", root);
dir = buf;
}
@@ -201,16 +201,11 @@ main(int argc, char **argv)
bool hadFailure = false;
bool hadSuccess = false;
- for (strlist_t::iterator it = services.begin();
- it != services.end();
- ++it)
- {
- const char *service = (*it).c_str();
-
- char serviceFile[PATH_MAX];
+ for (const auto & service : services) {
+ std::string serviceFile(dir);
if (! doOnlyFile) {
- snprintf(serviceFile, sizeof serviceFile, "%s/%s.logcontrol", dir, service);
- file = serviceFile;
+ serviceFile.append("/").append(service).append(".logcontrol");
+ file = serviceFile.c_str();
}
// fprintf(stderr, "Log control file %s:\n", file);