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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 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]);
-- 
2.28.0




[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux