Fix: Fix name collision (#5937)

* Fix: Fix name collision

* Fix: Fix possible override

* Fix: Use reentrant providing time function

* Fix: Fix override

* Update AssbinFileWriter.cpp

Revert, not portable.

* Update AssxmlFileWriter.cpp

Revert asctime_r, not portable.
This commit is contained in:
Kim Kulling
2024-12-23 12:23:42 +01:00
committed by GitHub
parent ecc8a1c869
commit 9f3a7e95ab
5 changed files with 11 additions and 14 deletions

View File

@@ -661,11 +661,10 @@ void glTFImporter::ImportEmbeddedTextures(glTF::Asset &r) {
if (strncmp(ext, "jpeg", 4) == 0) {
ext = "jpg";
}
const size_t len = strlen(ext);
if (len <= 3) {
strncpy(tex->achFormatHint, ext, len);
}
tex->achFormatHint[3] = '\0';
size_t len = strlen(ext);
if (len > 3) len = 3;
memcpy(tex->achFormatHint, ext, len);
}
}
}