From: Alejandro Colomar Date: Thu, 3 Sep 2020 19:39:56 +0000 (+0200) Subject: sysctl.2: Use sizeof consistently X-Git-Tag: man-pages-5.09~466 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bbedcb755a9366121142e5b182e2834c4cb35bf2;p=thirdparty%2Fman-pages.git sysctl.2: Use sizeof consistently Use ``sizeof`` consistently through all the examples in the following way: - Use the name of the variable instead of its type as argument for ``sizeof``. Rationale: https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory Signed-off-by: Alejandro Colomar Signed-off-by: Michael Kerrisk --- diff --git a/man2/sysctl.2 b/man2/sysctl.2 index 65f79516d8..1610604902 100644 --- a/man2/sysctl.2 +++ b/man2/sysctl.2 @@ -154,7 +154,7 @@ main(void) size_t osnamelth; int name[] = { CTL_KERN, KERN_OSTYPE }; - memset(&args, 0, sizeof(struct __sysctl_args)); + memset(&args, 0, sizeof(args)); args.name = name; args.nlen = sizeof(name)/sizeof(name[0]); args.oldval = osname;