aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <colomar.6.4.3@gmail.com>2020-09-03 21:55:11 +0200
committerMichael Kerrisk <mtk.manpages@gmail.com>2020-09-05 14:49:42 +0200
commit23766e41b5559acddfdfa9f86379376d51f85256 (patch)
treea0dcdca18e23fbc64f9c29c7408bc5a745868ec6
parentbaa51272f56ea2df2e498bbe985ec12110b48ca3 (diff)
downloadman-pages-23766e41b5559acddfdfa9f86379376d51f85256.tar.gz
rtnetlink.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@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
-rw-r--r--man3/rtnetlink.32
1 files changed, 1 insertions, 1 deletions
diff --git a/man3/rtnetlink.3 b/man3/rtnetlink.3
index 2d9fa05a2a..f8b6c255a2 100644
--- a/man3/rtnetlink.3
+++ b/man3/rtnetlink.3
@@ -114,7 +114,7 @@ req.if.ifi_change = 0xffffffff; /* ??? */
rta = (struct rtattr *)(((char *) &req) +
NLMSG_ALIGN(req.nh.nlmsg_len));
rta\->rta_type = IFLA_MTU;
-rta\->rta_len = RTA_LENGTH(sizeof(unsigned int));
+rta\->rta_len = RTA_LENGTH(sizeof(mtu));
req.nh.nlmsg_len = NLMSG_ALIGN(req.nh.nlmsg_len) +
RTA_LENGTH(sizeof(mtu));
memcpy(RTA_DATA(rta), &mtu, sizeof(mtu));