This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB 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/RFA] Incorrect call to memset in ppc/sim/hw_nvram.c


There is an apparently incorrect call to memset in ppc/sim/hw_nvram.c.
The call is intended to zero out memory, but the zero was passed as
the size argument, turning the call into a nop.

I have no idea what problems this could cause, if any.

Here is the patch.

Ian


2003-05-14  Ian Lance Taylor  <ian@airs.com>

	* hw_nvram.c (hw_nvram_init_address): Correct call to memset--swap
	second and third arguments.


Index: hw_nvram.c
===================================================================
RCS file: /cvs/src/src/sim/ppc/hw_nvram.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 hw_nvram.c
--- hw_nvram.c	16 Apr 1999 01:35:09 -0000	1.1.1.1
+++ hw_nvram.c	14 May 2003 22:22:07 -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;


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