From 799dfdcbbc9987e013bf08a46da14d769d98ac86 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Sat, 9 Jun 2012 11:04:18 +0200 Subject: [PATCH] Fix two wrong sizeof() usages. It should be taking the size of the variable the pointer points to, instead of the size of the pointer itself. --- sys/emulation/dragonfly12/dfbsd12_stat.c | 4 +--- tools/tools/net80211/w00t/redir/buddy.c | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/emulation/dragonfly12/dfbsd12_stat.c b/sys/emulation/dragonfly12/dfbsd12_stat.c index 16ae75c730..04872a5529 100644 --- a/sys/emulation/dragonfly12/dfbsd12_stat.c +++ b/sys/emulation/dragonfly12/dfbsd12_stat.c @@ -30,8 +30,6 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $DragonFly: src/sys/emulation/dragonfly12/dfbsd12_stat.c,v 1.4 2008/09/17 21:44:16 dillon Exp $ */ #include "opt_compatdf12.h" @@ -54,7 +52,7 @@ static void cvtstat(struct dfbsd12_stat *oldstat, struct stat *newstat) { - bzero(oldstat, sizeof(oldstat)); + bzero(oldstat, sizeof(*oldstat)); oldstat->st_dev = newstat->st_dev; oldstat->st_ino = newstat->st_ino; /* truncation */ diff --git a/tools/tools/net80211/w00t/redir/buddy.c b/tools/tools/net80211/w00t/redir/buddy.c index 9935458b01..c9afccd297 100644 --- a/tools/tools/net80211/w00t/redir/buddy.c +++ b/tools/tools/net80211/w00t/redir/buddy.c @@ -125,7 +125,7 @@ int main(int argc, char *argv[]) int len; int raw; - memset(&s_in, 0, sizeof(&s_in)); + memset(&s_in, 0, sizeof(s_in)); s_in.sin_family = PF_INET; s_in.sin_port = htons(666); s_in.sin_addr.s_addr = INADDR_ANY; -- 2.41.0