From e77a76a28494bf05a76aeb77fdef22625946749d Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Thu, 4 Aug 2016 13:19:07 +0200 Subject: [PATCH] Cleanup --- src/cocoa_monitor.m | 2 +- src/win32_init.c | 2 +- src/wl_monitor.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cocoa_monitor.m b/src/cocoa_monitor.m index ac3e8584..0c8d313f 100644 --- a/src/cocoa_monitor.m +++ b/src/cocoa_monitor.m @@ -66,7 +66,7 @@ static char* getDisplayName(CGDirectDisplayID displayID) size = CFStringGetMaximumSizeForEncoding(CFStringGetLength(value), kCFStringEncodingUTF8); - name = calloc(size + 1, sizeof(char)); + name = calloc(size + 1, 1); CFStringGetCString(value, name, size, kCFStringEncodingUTF8); CFRelease(info); diff --git a/src/win32_init.c b/src/win32_init.c index e7dcb04e..b2a0a679 100644 --- a/src/win32_init.c +++ b/src/win32_init.c @@ -377,7 +377,7 @@ char* _glfwCreateUTF8FromWideStringWin32(const WCHAR* source) if (!length) return NULL; - target = calloc(length, sizeof(char)); + target = calloc(length, 1); if (!WideCharToMultiByte(CP_UTF8, 0, source, -1, target, length, NULL, NULL)) { diff --git a/src/wl_monitor.c b/src/wl_monitor.c index 3b2b95fe..27731c22 100644 --- a/src/wl_monitor.c +++ b/src/wl_monitor.c @@ -120,7 +120,7 @@ void _glfwAddOutputWayland(uint32_t name, uint32_t version) struct wl_output *output; char name_str[80]; - memset(name_str, 0, 80 * sizeof(char)); + memset(name_str, 0, sizeof(name_str)); snprintf(name_str, 79, "wl_output@%u", name); if (version < 2)