]> granicus.if.org Git - taglib/commitdiff
IT: add term. NUL to messages
authorMathias Panzenböck <grosser.meister.morti@gmx.net>
Thu, 23 Jun 2011 23:50:43 +0000 (01:50 +0200)
committerMathias Panzenböck <grosser.meister.morti@gmx.net>
Thu, 23 Jun 2011 23:50:43 +0000 (01:50 +0200)
taglib/it/itfile.cpp

index ed175c85f2ad78f51d9cd6ecbf0b5c0b962b2fd7..183a4f00eb3ebfd345a16ccc1c45286fda77bda1 100644 (file)
@@ -131,6 +131,10 @@ bool IT::File::save()
   for(uint i = instrumentCount + sampleCount; i < lines.size(); ++ i)
     messageLines.append(lines[i]);
   ByteVector message = messageLines.toString("\r").data(String::Latin1);
+
+  // it's actually not really stated if the message needs a
+  // terminating NUL but it does not hurt to add one:
+  message.append((char)0);
   if(message.size() > 8000)
     message.resize(8000);