aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <colomar.6.4.3@gmail.com>2020-09-03 21:27:55 +0200
committerMichael Kerrisk <mtk.manpages@gmail.com>2020-09-05 14:49:42 +0200
commitaff660d379c2462a7875392d96b45abbc46d74c6 (patch)
tree31964df4e35a185b1340ad374d84c23cd72f90c9
parentd60a7a9a4bd49285823528deb67694e0b83ef0af (diff)
downloadman-pages-aff660d379c2462a7875392d96b45abbc46d74c6.tar.gz
open_by_handle_at.2: 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--man2/open_by_handle_at.24
1 files changed, 2 insertions, 2 deletions
diff --git a/man2/open_by_handle_at.2 b/man2/open_by_handle_at.2
index f3a863814a..c6b1fb3244 100644
--- a/man2/open_by_handle_at.2
+++ b/man2/open_by_handle_at.2
@@ -586,7 +586,7 @@ main(int argc, char *argv[])
/* Reallocate file_handle structure with correct size */
- fhsize = sizeof(struct file_handle) + fhp\->handle_bytes;
+ fhsize = sizeof(*fhp) + fhp\->handle_bytes;
fhp = realloc(fhp, fhsize); /* Copies fhp\->handle_bytes */
if (fhp == NULL)
errExit("realloc");
@@ -707,7 +707,7 @@ main(int argc, char *argv[])
/* Given handle_bytes, we can now allocate file_handle structure */
- fhp = malloc(sizeof(struct file_handle) + handle_bytes);
+ fhp = malloc(sizeof(*fhp) + handle_bytes);
if (fhp == NULL)
errExit("malloc");