summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenneth Mortensen <mortensenit@users.noreply.github.com>2014-11-13 10:44:33 +0100
committerKenneth Mortensen <mortensenit@users.noreply.github.com>2014-11-13 10:44:33 +0100
commitfcc439f1387887110ccbf0e9e6a6d116eba315ac (patch)
treedf3cb11a194573a51bc0d9e1740168cc30f0b177
parentde6eb96c71873fb23f0847424dca724b933ee399 (diff)
downloaddabmod-fcc439f1387887110ccbf0e9e6a6d116eba315ac.tar.gz
dabmod-fcc439f1387887110ccbf0e9e6a6d116eba315ac.tar.bz2
dabmod-fcc439f1387887110ccbf0e9e6a6d116eba315ac.zip
No error termination in case of zero read bytes
-rw-r--r--src/InputFileReader.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/InputFileReader.cpp b/src/InputFileReader.cpp
index 52fbb99..4a7e050 100644
--- a/src/InputFileReader.cpp
+++ b/src/InputFileReader.cpp
@@ -284,13 +284,18 @@ int InputFileReader::GetNextFrame(void* buffer)
if (read_bytes != frameSize) {
// A short read of a frame (i.e. reading an incomplete frame)
// is not tolerated. Input files must not contain incomplete frames
- fprintf(stderr,
- "Unable to read a complete frame of %u data bytes from input file!\n",
- frameSize);
-
- perror(filename_.c_str());
- logger_.level(error) << "Unable to read from input file!";
- return -1;
+ if (read_bytes != 0){
+ fprintf(stderr,
+ "Unable to read a complete frame of %u data bytes from input file!\n",
+ frameSize);
+
+ perror(filename_.c_str());
+ logger_.level(error) << "Unable to read from input file!";
+ return -1;
+ }
+ else {
+ return 0;
+ }
}
memset(&((uint8_t*)buffer)[frameSize], 0x55, 6144 - frameSize);