Parcourir la source

Null-terminate string

In theory it shouldn't be necessary since the length is specified but there are parts like https://github.com/assimp/assimp/blob/master/code/MaterialSystem.cpp#L74 that depend on it.
Gargaj il y a 11 ans
Parent
commit
397989e169
1 fichiers modifiés avec 1 ajouts et 0 suppressions
  1. 1 0
      code/AssbinLoader.cpp

+ 1 - 0
code/AssbinLoader.cpp

@@ -138,6 +138,7 @@ aiString Read<aiString>(IOStream * stream)
 	aiString s;
 	stream->Read(&s.length,4,1);
 	stream->Read(s.data,s.length,1);
+	s.data[s.length] = 0;
 	return s;
 }