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
@@ -58,7 +58,7 @@ static const char* getDisplayName(CGDirectDisplayID displayID)
size = CFStringGetMaximumSizeForEncoding(CFStringGetLength(value),
kCFStringEncodingUTF8);
name = (char*) malloc(size + 1);
name = (char*) calloc(size + 1, sizeof(char));
CFStringGetCString(value, name, size, kCFStringEncodingUTF8);
CFRelease(info);
@@ -341,7 +341,7 @@ GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* found)
modes = CGDisplayCopyAllDisplayModes(monitor->ns.displayID, NULL);
count = CFArrayGetCount(modes);
result = (GLFWvidmode*) malloc(sizeof(GLFWvidmode) * count);
result = (GLFWvidmode*) calloc(count, sizeof(GLFWvidmode));
*found = 0;
for (i = 0; i < count; i++)