Re: [PATCH (2) 20/34] mbsinit.3: Use sizeof consistently

Michael Kerrisk (man-pages)
2020-09-04T15:27:58Z

Hello Alex,

On 9/4/20 4:44 PM, Alejandro Colomar wrote:
>>From 77587b9c0b58cde232ea3bfaeef5f50607d83b5e Mon Sep 17 00:00:00 2001
> From: Alejandro Colomar <colomar.6.4.3@gmail.com>
> Date: Thu, 3 Sep 2020 21:50:10 +0200
> Subject: [PATCH 20/34] mbsinit.3: 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

Thanks. Patch applied.

Cheers,

Michael

> Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
> ---
> man3/mbsinit.3 | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/man3/mbsinit.3 b/man3/mbsinit.3
> index aeaa6ce88..74fe48f86 100644
> --- a/man3/mbsinit.3
> +++ b/man3/mbsinit.3
> @@ -59,7 +59,7 @@ in initial state is to set it to zero:
> .in +4n
> .EX
> mbstate_t state;
> -memset(&state, 0, sizeof(mbstate_t));
> +memset(&state, 0, sizeof(state));
> .EE
> .in
> .PP
>

--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/