Skip to content

Commit

Permalink
fix some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
FunkyFr3sh committed Apr 11, 2024
1 parent 4dc8eb5 commit 3089c88
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/opengl_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ void oglu_init()
if (glversion)
{
strncpy(g_oglu_version, glversion, sizeof(g_oglu_version) - 1);
const char deli[2] = " ";
strtok(g_oglu_version, deli);
g_oglu_version[sizeof(g_oglu_version) - 1] = '\0'; /* strncpy fix */
strtok(g_oglu_version, " ");
}
else
{
Expand Down
3 changes: 2 additions & 1 deletion src/render_ogl.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ static void ogl_build_programs()
char shader_path[MAX_PATH] = { 0 };

strncpy(shader_path, g_config.shader, sizeof(shader_path));
shader_path[sizeof(shader_path) - 1] = '\0'; /* strncpy fix */

if (GetFileAttributes(shader_path) == INVALID_FILE_ATTRIBUTES)
{
Expand Down Expand Up @@ -530,7 +531,7 @@ static void ogl_init_scale_program()

glBindVertexArray(0);

float input_size[2], output_size[2], texture_size[2];
float input_size[2] = { 0 }, output_size[2] = { 0 }, texture_size[2] = { 0 };

input_size[0] = (float)g_ddraw.width;
input_size[1] = (float)g_ddraw.height;
Expand Down

0 comments on commit 3089c88

Please sign in to comment.