Skip to contentSkip to conversation

incorrect memset usage.

PATCH New Dave Jones 1 participant 1 message Mar 31, 2005

lore
Share & tools
lore

Dave Jones

author
#0 lore raw

PATCH 1/1 incorrect memset usage.

two patches, one for stable, one for unstable..
memset args are swapped..

Dave

tools/libxutil/sys_net.c renamed from tools/libxutil/sys_net.c~ +1 -1
@@ -310,7 +310,7 @@ char *mac_ntoa(const unsigned char *mac)
     static char buf[MAC_LENGTH + 1];
     int buf_n = sizeof(buf);
 
-    memset(buf, buf_n, 0);
+    memset(buf, 0, buf_n);
     snprintf(buf, buf_n, "%02x:%02x:%02x:%02x:%02x:%02x",
              mac[0], mac[1], mac[2],
              mac[3], mac[4], mac[5]);
tools/libxutil/sys_net.c renamed from tools/libxutil/sys_net.c~ +1 -1
@@ -310,7 +310,7 @@ char *mac_ntoa(const unsigned char *mac)
     static char buf[MAC_LENGTH + 1];
     int buf_n = sizeof(buf);
 
-    memset(buf, buf_n, 0);
+    memset(buf, 0, buf_n);
     snprintf(buf, buf_n, "%02x:%02x:%02x:%02x:%02x:%02x",
              mac[0], mac[1], mac[2],
              mac[3], mac[4], mac[5]);
tools/ioemu/iodev/harddrv.cc renamed from tools/ioemu/iodev/harddrv.cc~ +1 -1
@@ -3666,7 +3666,7 @@ ssize_t sparse_image_t::read_page_fragme
    }
    else
    {
-     memset(buf, read_size, 0);
+     memset(buf, 0, read_size);
    }
  }
  else