summaryrefslogtreecommitdiff
path: root/src/midimapparser.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/midimapparser.cc')
-rw-r--r--src/midimapparser.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/midimapparser.cc b/src/midimapparser.cc
index 3c8eed4..f66d063 100644
--- a/src/midimapparser.cc
+++ b/src/midimapparser.cc
@@ -57,5 +57,8 @@ int MidiMapParser::readData(std::string& data, std::size_t size)
return -1;
}
- return fread((char*)data.c_str(), 1, size, fd);
+ data.resize(size);
+ auto nr_of_bytes_read = fread((void*)data.data(), 1, size, fd);
+ data.resize(nr_of_bytes_read);
+ return nr_of_bytes_read;
}