From f630b24d7a08bb045f9aa7911bcd3477ebc6aba2 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 29 May 2024 14:03:52 +0900 Subject: [PATCH] Fix `calloc` arguments order for -Wcalloc-transposed-args --- win32/win32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/win32/win32.c b/win32/win32.c index c51d53595f..0d9cc087dc 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -1950,7 +1950,7 @@ w32_cmdvector(const WCHAR *cmd, char ***vec, UINT cp, rb_encoding *enc) } } - curr = (NtCmdLineElement *)calloc(sizeof(NtCmdLineElement), 1); + curr = (NtCmdLineElement *)calloc(1, sizeof(NtCmdLineElement)); if (!curr) goto do_nothing; curr->str = rb_w32_wstr_to_mbstr(cp, base, len, &curr->len); curr->flags |= NTMALLOC; @@ -2156,7 +2156,7 @@ w32_wopendir(const WCHAR *wpath) // // Get us a DIR structure // - p = calloc(sizeof(DIR), 1); + p = calloc(1, sizeof(DIR)); if (p == NULL) return NULL;