This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH]: backwards memset args


Hi,

  This has been reported by Moritz Jodeit <moritz@jodeit.org> to the OpenBSD
bug tracking system.
  I've not included a ChangeLog entry since I believe Moritz should get the
credit and I'm not sure how to proceed in this case.
  Thanks,

  f.-

Index: bfd/peXXigen.c
===================================================================
RCS file: /cvs/src/src/bfd/peXXigen.c,v
retrieving revision 1.10
diff -u -r1.10 peXXigen.c
--- bfd/peXXigen.c	6 Jun 2002 10:45:14 -0000	1.10
+++ bfd/peXXigen.c	16 Jul 2002 13:04:03 -0000
@@ -620,7 +620,7 @@
   extra->NumberOfRvaAndSizes = IMAGE_NUMBEROF_DIRECTORY_ENTRIES;
 
   /* first null out all data directory entries ..  */
-  memset (extra->DataDirectory, sizeof (extra->DataDirectory), 0);
+  memset (extra->DataDirectory, 0, sizeof (extra->DataDirectory));
 
   add_data_entry (abfd, extra, 0, ".edata", ib);
 
Index: gas/config/tc-z8k.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-z8k.c,v
retrieving revision 1.17
diff -u -r1.17 tc-z8k.c
--- gas/config/tc-z8k.c	8 Jun 2002 07:37:16 -0000	1.17
+++ gas/config/tc-z8k.c	16 Jul 2002 13:04:08 -0000
@@ -1005,7 +1005,7 @@
   frag_wane (frag_now);
   frag_new (0);
 
-  memset (buffer, 20, 0);
+  memset (buffer, 0, 20);
   class_ptr = this_try->byte_info;
 
   for (nibble = 0; (c = *class_ptr++); nibble++)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]