Fix two wrong sizeof() usages.
authorSascha Wildner <saw@online.de>
Sat, 9 Jun 2012 09:04:18 +0000 (11:04 +0200)
committerSascha Wildner <saw@online.de>
Sat, 9 Jun 2012 09:04:59 +0000 (11:04 +0200)
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
tools/tools/net80211/w00t/redir/buddy.c

index 16ae75c..04872a5 100644 (file)
@@ -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 */
index 9935458..c9afccd 100644 (file)
@@ -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;