aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Saleem Abdulrasool <compnerd@compnerd.org> 2013-02-24 19:22:50 -0800
committerAvatar Saleem Abdulrasool <compnerd@compnerd.org> 2013-02-26 20:25:25 -0800
commit036c588e36df46dbd7a41b595747eccef3b44833 (patch)
tree8769f9eb13c04656d094ec79882ad34ce7dc3e70
parentac8b624f587237bf4b468883cab73b0d99e074ea (diff)
downloadpaludis-036c588e36df46dbd7a41b595747eccef3b44833.tar.gz
paludis-036c588e36df46dbd7a41b595747eccef3b44833.tar.xz
fix stringification of lines
This corrects an application error found by clang's analyser. The file location would be used as a base offset from which " would be based, resulting in an invalid character being appended to the error message.
-rw-r--r--paludis/util/config_file.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/paludis/util/config_file.cc b/paludis/util/config_file.cc
index f62d63c..112c53a 100644
--- a/paludis/util/config_file.cc
+++ b/paludis/util/config_file.cc
@@ -213,7 +213,7 @@ LineConfigFile::LineConfigFile(const Source & sr, const LineConfigFileOptions &
}
else
throw ConfigFileError(sr.filename(),
- "Something is very strange at line '" + stringify(parser.current_line_number() + "'"));
+ "Something is very strange at line '" + stringify(parser.current_line_number()) + "'");
}
continue;
}
@@ -276,7 +276,7 @@ LineConfigFile::LineConfigFile(const Source & sr, const LineConfigFileOptions &
if (! parser.consume(simple_parser::exact("\n")))
if (! parser.eof())
throw ConfigFileError(sr.filename(),
- "Something is very strange at line '" + stringify(parser.current_line_number() + "'"));
+ "Something is very strange at line '" + stringify(parser.current_line_number()) + "'");
break;
}
else if (parser.consume(simple_parser::exact("#") >> word))
@@ -603,7 +603,7 @@ KeyValueConfigFile::KeyValueConfigFile(
}
else
throw ConfigFileError(sr.filename(),
- "Something is very strange at line '" + stringify(parser.current_line_number() + "'"));
+ "Something is very strange at line '" + stringify(parser.current_line_number()) + "'");
}
continue;
}
@@ -634,7 +634,7 @@ KeyValueConfigFile::KeyValueConfigFile(
<< "No newline at end of file";
else
throw ConfigFileError(sr.filename(),
- "Something is very strange at line '" + stringify(parser.current_line_number() + "'"));
+ "Something is very strange at line '" + stringify(parser.current_line_number()) + "'");
}
continue;
}
@@ -710,7 +710,7 @@ KeyValueConfigFile::KeyValueConfigFile(
<< "No newline at end of file";
else
throw ConfigFileError(sr.filename(), "Expected newline after ']' at line "
- + stringify(parser.current_line_number() + "'"));
+ + stringify(parser.current_line_number()) + "'");
}
if (sec_s.empty())
@@ -790,7 +790,7 @@ KeyValueConfigFile::KeyValueConfigFile(
<< "No newline at end of file";
else
throw ConfigFileError(sr.filename(),
- "Something is very strange at line '" + stringify(parser.current_line_number() + "'"));
+ "Something is very strange at line '" + stringify(parser.current_line_number()) + "'");
}
break;
}