Skip to content

Commit 6529fda

Browse files
committed
fix coverity issue, unchecked return value on glfw init
1 parent 11085e9 commit 6529fda

File tree

1 file changed

+4
-2
lines changed
  • source/examples/commandlineoutput

1 file changed

+4
-2
lines changed

source/examples/commandlineoutput/main.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@ void error(int errnum, const char * errmsg)
3535

3636
int main(int /*argc*/, char * /*argv*/[])
3737
{
38-
// Initialize GLFW with error callback and window hints
39-
glfwInit();
38+
// Initialize GLFW
39+
if (!glfwInit())
40+
return 1;
41+
4042
glfwSetErrorCallback(error);
4143
glfwWindowHint(GLFW_VISIBLE, false);
4244
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);

0 commit comments

Comments
 (0)