projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Revert "Proposed fix for coverity #29372" because of causing Segmentation
[supertux.git]
/
src
/
supertux
/
console.cpp
diff --git
a/src/supertux/console.cpp
b/src/supertux/console.cpp
index
71b0c5f
..
1d27bc8
100644
(file)
--- a/
src/supertux/console.cpp
+++ b/
src/supertux/console.cpp
@@
-257,11
+257,11
@@
void
Console::show_history(int offset_)
{
while ((offset_ > 0) && (m_history_position != m_history.end())) {
Console::show_history(int offset_)
{
while ((offset_ > 0) && (m_history_position != m_history.end())) {
-
m_history_position++
;
+
++m_history_position
;
offset_--;
}
while ((offset_ < 0) && (m_history_position != m_history.begin())) {
offset_--;
}
while ((offset_ < 0) && (m_history_position != m_history.begin())) {
-
m_history_position--
;
+
--m_history_position
;
offset_++;
}
if (m_history_position == m_history.end()) {
offset_++;
}
if (m_history_position == m_history.end()) {
@@
-424,10
+424,9
@@
Console::parse(std::string s)
// split line into list of args
std::vector<std::string> args;
// split line into list of args
std::vector<std::string> args;
- size_t start = 0;
size_t end = 0;
while (1) {
size_t end = 0;
while (1) {
- start = s.find_first_not_of(" ,", end);
+ s
ize_t s
tart = s.find_first_not_of(" ,", end);
end = s.find_first_of(" ,", start);
if (start == s.npos) break;
args.push_back(s.substr(start, end-start));
end = s.find_first_of(" ,", start);
if (start == s.npos) break;
args.push_back(s.substr(start, end-start));
@@
-561,7
+560,7
@@
Console::draw(DrawingContext& context)
}
int skipLines = -m_offset;
}
int skipLines = -m_offset;
- for (std::list<std::string>::iterator i = m_buffer.m_lines.begin(); i != m_buffer.m_lines.end();
i++
)
+ for (std::list<std::string>::iterator i = m_buffer.m_lines.begin(); i != m_buffer.m_lines.end();
++i
)
{
if (skipLines-- > 0) continue;
lineNo++;
{
if (skipLines-- > 0) continue;
lineNo++;