]> granicus.if.org Git - taglib/commitdiff
IT: the max. 8000 bytes msg. length have to include the NUL
authorMathias Panzenböck <grosser.meister.morti@gmx.net>
Thu, 23 Jun 2011 23:53:20 +0000 (01:53 +0200)
committerMathias Panzenböck <grosser.meister.morti@gmx.net>
Thu, 23 Jun 2011 23:53:20 +0000 (01:53 +0200)
taglib/it/itfile.cpp

index 183a4f00eb3ebfd345a16ccc1c45286fda77bda1..3b2ca8764d6b258e2b9f4d7569587b26c2df56b2 100644 (file)
@@ -134,9 +134,9 @@ bool IT::File::save()
 
   // it's actually not really stated if the message needs a
   // terminating NUL but it does not hurt to add one:
+  if(message.size() > 7999)
+    message.resize(7999);
   message.append((char)0);
-  if(message.size() > 8000)
-    message.resize(8000);
 
   ushort special = 0;
   ushort messageLength = 0;