Skip to content

Commit

Permalink
Fixed body string initialization code (0 byte for empty strings)
Browse files Browse the repository at this point in the history
Also fixed same code in filesystem module

ariya#10158
  • Loading branch information
Dmitry Parshin committed Sep 10, 2013
1 parent 0923a31 commit aac74b5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/filesystem.cpp
Expand Up @@ -106,7 +106,7 @@ QString File::read(const QVariant &n)
} else {
data = m_file->read(bytesToRead);
}
QString ret(data.size());
QString ret(data.size(), ' ');
for(int i = 0; i < data.size(); ++i) {
ret[i] = data.at(i);
}
Expand Down
2 changes: 1 addition & 1 deletion src/networkreplyproxy.cpp
Expand Up @@ -59,7 +59,7 @@ QString NetworkReplyProxy::body()
{
//converting data to QString in a special way(without charset encoding),
//similar to File::read method in 'filesystem' module.
QString ret(m_data.size());
QString ret(m_data.size(), ' ');
for(int i = 0; i < m_data.size(); ++i) {
ret[i] = m_data.at(i);
}
Expand Down

0 comments on commit aac74b5

Please sign in to comment.