sprintf_s unix compatible fix

This commit is contained in:
JackCarterSmith 2022-08-19 19:01:53 +02:00
parent 09f87160bb
commit 63f5977aae
Signed by: JackCarterSmith
GPG Key ID: 832E52F4E23F8F24

8
obj.c
View File

@ -2451,18 +2451,18 @@ void obj_write(const obj *O, const char *obj, const char *mtl, const char *outPa
if (obj) {
if (outPath != NULL)
sprintf_s(objPath, MAXSTR, EXPORT_FORMAT, outPath, obj);
snprintf(objPath, MAXSTR, EXPORT_FORMAT, outPath, obj);
else
sprintf_s(objPath, MAXSTR, "%s", obj);
snprintf(objPath, MAXSTR, "%s", obj);
obj_write_obj(O, objPath, mtl, prec);
}
if (mtl) {
if (outPath != NULL)
sprintf_s(mtlPath, MAXSTR, EXPORT_FORMAT, outPath, mtl);
snprintf(mtlPath, MAXSTR, EXPORT_FORMAT, outPath, mtl);
else
sprintf_s(mtlPath, MAXSTR, "%s", mtl);
snprintf(mtlPath, MAXSTR, "%s", mtl);
obj_write_mtl(O, mtlPath);
}