summaryrefslogtreecommitdiffhomepage
path: root/src/models.c
diff options
context:
space:
mode:
authorRay <[email protected]>2018-04-02 18:10:38 +0200
committerGitHub <[email protected]>2018-04-02 18:10:38 +0200
commit3e0de314244fa943d1944bb92901043279b0a03e (patch)
treeae36ed7cbb10904be2acaa798177206accb2f132 /src/models.c
parentbefd363966307068ed8a6709b6db6204a84a3531 (diff)
parent201007e426816eea145c6ed516165d8a10fc4301 (diff)
downloadraylib-3e0de314244fa943d1944bb92901043279b0a03e.tar.gz
raylib-3e0de314244fa943d1944bb92901043279b0a03e.zip
Merge pull request #504 from Martinfx/master
Fix potential bugs from static analysis
Diffstat (limited to 'src/models.c')
-rw-r--r--src/models.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/models.c b/src/models.c
index 0cfcf486..f9aa1805 100644
--- a/src/models.c
+++ b/src/models.c
@@ -2347,7 +2347,7 @@ static Mesh LoadOBJ(const char *fileName)
// NOTE: Texture map parameters are not supported
static Material LoadMTL(const char *fileName)
{
- #define MAX_BUFFER_SIZE 128
+ #define MAX_BUFFER_SIZE 128
Material material = { 0 };
@@ -2375,7 +2375,7 @@ static Material LoadMTL(const char *fileName)
case 'n': // newmtl string Material name. Begins a new material description.
{
// TODO: Support multiple materials in a single .mtl
- sscanf(buffer, "newmtl %s", mapFileName);
+ sscanf(buffer, "newmtl %127s", mapFileName);
TraceLog(LOG_INFO, "[%s] Loading material...", mapFileName);
}
@@ -2440,12 +2440,12 @@ static Material LoadMTL(const char *fileName)
{
if (buffer[5] == 'd') // map_Kd string Diffuse color texture map.
{
- result = sscanf(buffer, "map_Kd %s", mapFileName);
+ result = sscanf(buffer, "map_Kd %127s", mapFileName);
if (result != EOF) material.maps[MAP_DIFFUSE].texture = LoadTexture(mapFileName);
}
else if (buffer[5] == 's') // map_Ks string Specular color texture map.
{
- result = sscanf(buffer, "map_Ks %s", mapFileName);
+ result = sscanf(buffer, "map_Ks %127s", mapFileName);
if (result != EOF) material.maps[MAP_SPECULAR].texture = LoadTexture(mapFileName);
}
else if (buffer[5] == 'a') // map_Ka string Ambient color texture map.
@@ -2455,12 +2455,12 @@ static Material LoadMTL(const char *fileName)
} break;
case 'B': // map_Bump string Bump texture map.
{
- result = sscanf(buffer, "map_Bump %s", mapFileName);
+ result = sscanf(buffer, "map_Bump %127s", mapFileName);
if (result != EOF) material.maps[MAP_NORMAL].texture = LoadTexture(mapFileName);
} break;
case 'b': // map_bump string Bump texture map.
{
- result = sscanf(buffer, "map_bump %s", mapFileName);
+ result = sscanf(buffer, "map_bump %127s", mapFileName);
if (result != EOF) material.maps[MAP_NORMAL].texture = LoadTexture(mapFileName);
} break;
case 'd': // map_d string Opacity texture map.
@@ -2485,7 +2485,7 @@ static Material LoadMTL(const char *fileName)
} break;
case 'b': // bump string Bump texture map
{
- result = sscanf(buffer, "bump %s", mapFileName);
+ result = sscanf(buffer, "bump %127s", mapFileName);
if (result != EOF) material.maps[MAP_NORMAL].texture = LoadTexture(mapFileName);
} break;
case 'T': // Tr float Transparency Tr (alpha). Tr is inverse of d