From eaf8c01ac99f9561870528ff608a073166be2163 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Nusser?= Date: Wed, 23 Mar 2016 15:07:17 +0100 Subject: Fix horribly stupid bug. --- src/midimapparser.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/midimapparser.cc') diff --git a/src/midimapparser.cc b/src/midimapparser.cc index 3c0e82b..2d4563a 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; } -- cgit v1.2.3