Replaced all uses of malloc with calloc.

This commit is contained in:
Camilla Berglund
2013-07-04 14:20:14 +02:00
parent 1947557eb1
commit 209a470a5f
6 changed files with 12 additions and 12 deletions
+2 -2
View File
@@ -312,7 +312,7 @@ GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* found)
sr = XRRGetScreenResources(_glfw.x11.display, _glfw.x11.root);
oi = XRRGetOutputInfo(_glfw.x11.display, sr, monitor->x11.output);
result = (GLFWvidmode*) malloc(sizeof(GLFWvidmode) * oi->nmode);
result = (GLFWvidmode*) calloc(oi->nmode, sizeof(GLFWvidmode));
for (i = 0; i < oi->nmode; i++)
{
@@ -354,7 +354,7 @@ GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* found)
{
*found = 1;
result = (GLFWvidmode*) malloc(sizeof(GLFWvidmode));
result = (GLFWvidmode*) calloc(1, sizeof(GLFWvidmode));
result[0].width = DisplayWidth(_glfw.x11.display, _glfw.x11.screen);
result[0].height = DisplayHeight(_glfw.x11.display, _glfw.x11.screen);