[PATCH (2) 28/34] strptime.3: Use sizeof consistently

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

 



>From f000e36d106a22d68f26e9cebe84758854739a42 Mon Sep 17 00:00:00 2001
From: Alejandro Colomar <colomar.6.4.3@xxxxxxxxx>
Date: Thu, 3 Sep 2020 21:56:21 +0200
Subject: [PATCH 28/34] strptime.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

Signed-off-by: Alejandro Colomar <colomar.6.4.3@xxxxxxxxx>
---
 man3/strptime.3 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man3/strptime.3 b/man3/strptime.3
index d12f298ff..ab7d76f9a 100644
--- a/man3/strptime.3
+++ b/man3/strptime.3
@@ -429,7 +429,7 @@ main(void)
     struct tm tm;
     char buf[255];

-    memset(&tm, 0, sizeof(struct tm));
+    memset(&tm, 0, sizeof(tm));
     strptime("2001\-11\-12 18:31:01", "%Y\-%m\-%d %H:%M:%S", &tm);
     strftime(buf, sizeof(buf), "%d %b %Y %H:%M", &tm);
     puts(buf);
-- 
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