mirror of
https://github.com/glfw/glfw.git
synced 2026-09-18 22:55:46 +00:00
Replaced all uses of malloc with calloc.
This commit is contained in:
+2
-2
@@ -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++)
|
||||
|
||||
Reference in New Issue
Block a user