mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-27 23:42:51 +02:00
Merge branch 'master' of https://github.com/tuxbox-neutrino/gui-neutrino into ni/tuxbox
Conflicts:
src/gui/dboxinfo.cpp
src/gui/infoviewer_bb.cpp
Origin commit data
------------------
Branch: ni/coolstream
Commit: 9e8dd73320
Author: vanhofen <vanhofen@gmx.de>
Date: 2017-10-02 (Mon, 02 Oct 2017)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -1598,8 +1598,16 @@ string readFile(string file)
|
||||
if (tmpData.is_open()) {
|
||||
tmpData.seekg(0, tmpData.end);
|
||||
int length = tmpData.tellg();
|
||||
if (length > 0xffff) { /* longer than 64k? better read in chunks! */
|
||||
cerr << __func__ << ": file " << file << " too big (" << length << " bytes)" << endl;
|
||||
return "";
|
||||
}
|
||||
tmpData.seekg(0, tmpData.beg);
|
||||
char* buffer = new char[length+1];
|
||||
if (! buffer) {
|
||||
cerr << __func__ << ": allocating " << (length + 1) << " bytes for buffer failed" << endl;
|
||||
return "";
|
||||
}
|
||||
tmpData.read(buffer, length);
|
||||
tmpData.close();
|
||||
buffer[length] = '\0';
|
||||
|
Reference in New Issue
Block a user