Re: [PATCH 35/35] qsort.3: Use sizeof consistently

Alejandro Colomar
2020-09-05T14:23:58Z

Hi Michael,

This one I sent it with git. It is *really* *really* simple :)

Cheers,
Alex

On 9/5/20 4:20 PM, Alejandro Colomar wrote:
> 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 <colomar.6.4.3@gmail.com>
> ---
> man3/qsort.3 | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/man3/qsort.3 b/man3/qsort.3
> index b49c2a9d3..e1af43cf0 100644
> --- a/man3/qsort.3
> +++ b/man3/qsort.3
> @@ -150,7 +150,7 @@ main(int argc, char *argv[])
> exit(EXIT_FAILURE);
> }
>
> - qsort(&argv[1], argc \- 1, sizeof(char *), cmpstringp);
> + qsort(&argv[1], argc \- 1, sizeof(argv[0]), cmpstringp);
>
> for (j = 1; j < argc; j++)
> puts(argv[j]);
>