summaryrefslogtreecommitdiffstats
path: root/helper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'helper.cpp')
-rw-r--r--helper.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/helper.cpp b/helper.cpp
index 270feb1..174f585 100644
--- a/helper.cpp
+++ b/helper.cpp
@@ -82,7 +82,11 @@ namespace Helper {
int readBytes = 0;
do {
read = file.read(data.data(), 512);
- readBytes += read;
+ if(read > 0){
+ readBytes += read;
+ }else{
+ return QString();
+ }
h.addData(data.data(), read);
} while(readBytes < numBytes);
QByteArray res = h.result();