From 7cf8e8d05da57806a784d8d26932731fd5b9d195 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Tue, 10 Feb 2004 17:28:31 +0000 Subject: [PATCH] Changed flist_init() to use offsetof(). --- flist.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/flist.c b/flist.c index 415de19b..873ffb8b 100644 --- a/flist.c +++ b/flist.c @@ -81,7 +81,7 @@ void init_flist(void) struct file_struct f; /* Figure out how big the file_struct is without trailing padding */ - file_struct_len = ((char*)&f.flags - (char*)&f) + sizeof f.flags; + file_struct_len = offsetof(struct file_struct, flags) + sizeof f.flags; } @@ -1175,8 +1175,7 @@ struct file_list *send_file_list(int f, int argc, char *argv[]) finish_filelist_progress(flist); } - if (flist->hlink_pool) - { + if (flist->hlink_pool) { pool_destroy(flist->hlink_pool); flist->hlink_pool = NULL; } -- 2.34.1