summaryrefslogtreecommitdiff
path: root/libfdt
diff options
context:
space:
mode:
authorGerald Van Baren <vanbaren@cideas.com>2008-01-07 23:47:32 -0500
committerGerald Van Baren <vanbaren@cideas.com>2008-01-08 15:03:47 -0500
commitad3006fe7e84667021753b74247b0bafd97ba35f (patch)
tree55da2b41d8c09dff562a9a6e2908d8fc921d5436 /libfdt
parentaec7135bc300e3340d18f203347ee00c5b5f68c0 (diff)
downloadu-boot-ad3006fe7e84667021753b74247b0bafd97ba35f.tar.gz
u-boot-ad3006fe7e84667021753b74247b0bafd97ba35f.tar.bz2
u-boot-ad3006fe7e84667021753b74247b0bafd97ba35f.zip
LIBFDT: use memmove() instead of memcpy()
This is partial patch from the DTC/libfdt commit 67b6b33b9b413a450a72135b5dc59c0a1e33e647 Author: David Gibson <david@gibson.dropbear.id.au> Date: Wed Nov 21 11:56:14 2007 +1100 The patch also fixes one genuine bug caught by valgrind - _packblocks() in fdt_rw.c was using memcpy() where it should have been using memmove(). Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>
Diffstat (limited to 'libfdt')
-rw-r--r--libfdt/fdt_rw.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libfdt/fdt_rw.c b/libfdt/fdt_rw.c
index dfe5628a33..6673f8ec96 100644
--- a/libfdt/fdt_rw.c
+++ b/libfdt/fdt_rw.c
@@ -358,12 +358,12 @@ static void _packblocks(const void *fdt, void *buf,
memmove(buf + mem_rsv_off, fdt + fdt_off_mem_rsvmap(fdt), mem_rsv_size);
fdt_set_off_mem_rsvmap(buf, mem_rsv_off);
- memcpy(buf + struct_off, fdt + fdt_off_dt_struct(fdt), struct_size);
+ memmove(buf + struct_off, fdt + fdt_off_dt_struct(fdt), struct_size);
fdt_set_off_dt_struct(buf, struct_off);
fdt_set_size_dt_struct(buf, struct_size);
- memcpy(buf + strings_off, fdt + fdt_off_dt_strings(fdt),
- fdt_size_dt_strings(fdt));
+ memmove(buf + strings_off, fdt + fdt_off_dt_strings(fdt),
+ fdt_size_dt_strings(fdt));
fdt_set_off_dt_strings(buf, strings_off);
fdt_set_size_dt_strings(buf, fdt_size_dt_strings(fdt));
}