Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/gnu Correct obviously wrong memset() args. OK'd by itojun.



details:   https://anonhg.NetBSD.org/src/rev/246c78bf97ee
branches:  trunk
changeset: 534297:246c78bf97ee
user:      mjl <mjl%NetBSD.org@localhost>
date:      Sat Jul 20 16:51:43 2002 +0000

description:
Correct obviously wrong memset() args. OK'd by itojun.

diffstat:

 gnu/dist/gas/config/tc-z8k.c          |  2 +-
 gnu/dist/toolchain/gdb/ser-pipe.c     |  2 +-
 gnu/dist/toolchain/gdb/ser-tcp.c      |  2 +-
 gnu/dist/toolchain/gdb/ser-unix.c     |  2 +-
 gnu/dist/toolchain/sim/ppc/hw_nvram.c |  2 +-
 gnu/usr.bin/gas/subsegs.c             |  6 +++---
 6 files changed, 8 insertions(+), 8 deletions(-)

diffs (90 lines):

diff -r a08aaf17013d -r 246c78bf97ee gnu/dist/gas/config/tc-z8k.c
--- a/gnu/dist/gas/config/tc-z8k.c      Sat Jul 20 16:30:18 2002 +0000
+++ b/gnu/dist/gas/config/tc-z8k.c      Sat Jul 20 16:51:43 2002 +0000
@@ -1027,7 +1027,7 @@
   frag_wane (frag_now);
   frag_new (0);
 
-  memset (buffer, 20, 0);
+  memset (buffer, 0, 20);
   class_ptr = this_try->byte_info;
 top:;
 
diff -r a08aaf17013d -r 246c78bf97ee gnu/dist/toolchain/gdb/ser-pipe.c
--- a/gnu/dist/toolchain/gdb/ser-pipe.c Sat Jul 20 16:30:18 2002 +0000
+++ b/gnu/dist/toolchain/gdb/ser-pipe.c Sat Jul 20 16:51:43 2002 +0000
@@ -133,7 +133,7 @@
 _initialize_ser_pipe (void)
 {
   struct serial_ops *ops = XMALLOC (struct serial_ops);
-  memset (ops, sizeof (struct serial_ops), 0);
+  memset (ops, 0, sizeof (struct serial_ops));
   ops->name = "pipe";
   ops->next = 0;
   ops->open = pipe_open;
diff -r a08aaf17013d -r 246c78bf97ee gnu/dist/toolchain/gdb/ser-tcp.c
--- a/gnu/dist/toolchain/gdb/ser-tcp.c  Sat Jul 20 16:30:18 2002 +0000
+++ b/gnu/dist/toolchain/gdb/ser-tcp.c  Sat Jul 20 16:51:43 2002 +0000
@@ -136,7 +136,7 @@
 _initialize_ser_tcp (void)
 {
   struct serial_ops *ops = XMALLOC (struct serial_ops);
-  memset (ops, sizeof (struct serial_ops), 0);
+  memset (ops, 0, sizeof (struct serial_ops));
   ops->name = "tcp";
   ops->next = 0;
   ops->open = tcp_open;
diff -r a08aaf17013d -r 246c78bf97ee gnu/dist/toolchain/gdb/ser-unix.c
--- a/gnu/dist/toolchain/gdb/ser-unix.c Sat Jul 20 16:30:18 2002 +0000
+++ b/gnu/dist/toolchain/gdb/ser-unix.c Sat Jul 20 16:51:43 2002 +0000
@@ -1284,7 +1284,7 @@
 _initialize_ser_hardwire (void)
 {
   struct serial_ops *ops = XMALLOC (struct serial_ops);
-  memset (ops, sizeof (struct serial_ops), 0);
+  memset (ops, 0, sizeof (struct serial_ops));
   ops->name = "hardwire";
   ops->next = 0;
   ops->open = hardwire_open;
diff -r a08aaf17013d -r 246c78bf97ee gnu/dist/toolchain/sim/ppc/hw_nvram.c
--- a/gnu/dist/toolchain/sim/ppc/hw_nvram.c     Sat Jul 20 16:30:18 2002 +0000
+++ b/gnu/dist/toolchain/sim/ppc/hw_nvram.c     Sat Jul 20 16:51:43 2002 +0000
@@ -140,7 +140,7 @@
     nvram->memory = zalloc(nvram->sizeof_memory);
   }
   else
-    memset(nvram->memory, nvram->sizeof_memory, 0);
+    memset(nvram->memory, 0, nvram->sizeof_memory);
   
   if (device_find_property(me, "timezone") == NULL)
     nvram->timezone = 0;
diff -r a08aaf17013d -r 246c78bf97ee gnu/usr.bin/gas/subsegs.c
--- a/gnu/usr.bin/gas/subsegs.c Sat Jul 20 16:30:18 2002 +0000
+++ b/gnu/usr.bin/gas/subsegs.c Sat Jul 20 16:51:43 2002 +0000
@@ -22,7 +22,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id: subsegs.c,v 1.4 1995/03/21 15:27:12 mycroft Exp $";
+static char rcsid[] = "$Id: subsegs.c,v 1.5 2002/07/20 16:51:44 mjl Exp $";
 #endif
 
 #include "as.h"
@@ -97,7 +97,7 @@
        /* It won't be used=> is ok if obstack... */
        /* pads the end of it for alignment. */
        frag_now=(fragS *)obstack_alloc(&frags,SIZEOF_STRUCT_FRAG);
-       memset(frag_now,  SIZEOF_STRUCT_FRAG, 0); 
+       memset(frag_now, 0, SIZEOF_STRUCT_FRAG); 
        /* This 1st frag will not be in any frchain. */
        /* We simply give subseg_new somewhere to scribble. */
        now_subseg = 42;                /* Lie for 1st call to subseg_new. */
@@ -254,7 +254,7 @@
                                 * This should be the only code that creates a frchainS.
                                 */
                                newP=(frchainS *)obstack_alloc(&frags,sizeof(frchainS));
-                               memset(newP, sizeof(frchainS), 0); 
+                               memset(newP, 0, sizeof(frchainS)); 
                                /* This begines on a good boundary */
                                /* because a obstack_done() preceeded  it. */
                                /* It implies an obstack_done(), so we */



Home | Main Index | Thread Index | Old Index