summaryrefslogtreecommitdiff
path: root/examples/OpenGL3test.cxx
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-09-26 16:12:18 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-09-26 16:12:18 +0200
commit2ffd4e4f1af16b17a286ff354603a717f5d828a5 (patch)
tree99e2d4a7e2fde8e3abb027eb687901440750ee00 /examples/OpenGL3test.cxx
parent53d9614adbb728fc4db983c9bb817c6eea870994 (diff)
Replace all calls to sprintf() by calls to snprintf().
Diffstat (limited to 'examples/OpenGL3test.cxx')
-rw-r--r--examples/OpenGL3test.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/OpenGL3test.cxx b/examples/OpenGL3test.cxx
index 26ee1b816..9de83b5bd 100644
--- a/examples/OpenGL3test.cxx
+++ b/examples/OpenGL3test.cxx
@@ -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);