4096 -> TINYOBJ_SSCANF_BUFFER_SIZE

This commit is contained in:
Shane Loretz
2017-06-01 14:09:15 -07:00
parent fb80e04212
commit 0f4a955e01

View File

@@ -1676,7 +1676,7 @@ bool LoadObj(attrib_t *attrib, std::vector<shape_t> *shapes,
if (token[0] == 't' && IS_SPACE(token[1])) { if (token[0] == 't' && IS_SPACE(token[1])) {
tag_t tag; tag_t tag;
char namebuf[4096]; char namebuf[TINYOBJ_SSCANF_BUFFER_SIZE];
token += 2; token += 2;
#ifdef _MSC_VER #ifdef _MSC_VER
sscanf_s(token, "%s", namebuf, (unsigned)_countof(namebuf)); sscanf_s(token, "%s", namebuf, (unsigned)_countof(namebuf));
@@ -1704,7 +1704,7 @@ bool LoadObj(attrib_t *attrib, std::vector<shape_t> *shapes,
tag.stringValues.resize(static_cast<size_t>(ts.num_strings)); tag.stringValues.resize(static_cast<size_t>(ts.num_strings));
for (size_t i = 0; i < static_cast<size_t>(ts.num_strings); ++i) { for (size_t i = 0; i < static_cast<size_t>(ts.num_strings); ++i) {
char stringValueBuffer[4096]; char stringValueBuffer[TINYOBJ_SSCANF_BUFFER_SIZE];
#ifdef _MSC_VER #ifdef _MSC_VER
sscanf_s(token, "%s", stringValueBuffer, sscanf_s(token, "%s", stringValueBuffer,
@@ -1986,7 +1986,7 @@ bool LoadObjWithCallback(std::istream &inStream, const callback_t &callback,
if (token[0] == 't' && IS_SPACE(token[1])) { if (token[0] == 't' && IS_SPACE(token[1])) {
tag_t tag; tag_t tag;
char namebuf[4096]; char namebuf[TINYOBJ_SSCANF_BUFFER_SIZE];
token += 2; token += 2;
#ifdef _MSC_VER #ifdef _MSC_VER
sscanf_s(token, "%s", namebuf, (unsigned)_countof(namebuf)); sscanf_s(token, "%s", namebuf, (unsigned)_countof(namebuf));
@@ -2014,7 +2014,7 @@ bool LoadObjWithCallback(std::istream &inStream, const callback_t &callback,
tag.stringValues.resize(static_cast<size_t>(ts.num_strings)); tag.stringValues.resize(static_cast<size_t>(ts.num_strings));
for (size_t i = 0; i < static_cast<size_t>(ts.num_strings); ++i) { for (size_t i = 0; i < static_cast<size_t>(ts.num_strings); ++i) {
char stringValueBuffer[4096]; char stringValueBuffer[TINYOBJ_SSCANF_BUFFER_SIZE];
#ifdef _MSC_VER #ifdef _MSC_VER
sscanf_s(token, "%s", stringValueBuffer, sscanf_s(token, "%s", stringValueBuffer,