summaryrefslogtreecommitdiff
path: root/option.cc
diff options
context:
space:
mode:
Diffstat (limited to 'option.cc')
-rw-r--r--option.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/option.cc b/option.cc
index b3673633..0581dab5 100644
--- a/option.cc
+++ b/option.cc
@@ -41,11 +41,11 @@ namespace {
char buf[128];
std::strcpy(buf, "option_");
char * p = &buf[7];
- for (const char * q = name.c_str(); *q; q++) {
- if (*q == '-')
+ foreach (char ch, name) {
+ if (ch == '-')
*p++ = '_';
else
- *p++ = *q;
+ *p++ = ch;
}
*p = '\0';