Replace all calls to sprintf() by calls to snprintf().

This commit is contained in:
ManoloFLTK
2022-09-26 16:12:18 +02:00
parent 53d9614adb
commit 2ffd4e4f1a
55 changed files with 174 additions and 157 deletions

View File

@@ -68,7 +68,7 @@ public:
gl_Position = vec4(p, 0.0, 0.0) + position;\
}";
char vss_string[300]; const char *vss = vss_string;
sprintf(vss_string, vss_format, Mslv, mslv);
snprintf(vss_string, 300, vss_format, Mslv, mslv);
const char *fss_format="#version %d%d\n\
in vec4 colourV;\
out vec4 fragColour;\
@@ -77,7 +77,7 @@ public:
fragColour = colourV;\
}";
char fss_string[200]; const char *fss = fss_string;
sprintf(fss_string, fss_format, Mslv, mslv);
snprintf(fss_string, 200, fss_format, Mslv, mslv);
GLint err; GLchar CLOG[1000]; GLsizei length;
vs = glCreateShader(GL_VERTEX_SHADER);
glShaderSource(vs, 1, &vss, NULL);