From: Wolfgang Denk Date: Mon, 09 Aug 2010 00:18:19 +0200 Subject: [U-Boot] [PATCH] memmove_wd: Allow overlapping memory area In-Reply-To: <1279701826-20083-1-git-send-email-alexander.stein@systec-electronic.com> References: <1279701826-20083-1-git-send-email-alexander.stein@systec-electronic.com> Message-ID: <20100808221819.4BEE71536EF@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Alexander Stein, In message <1279701826-20083-1-git-send-email-alexander.stein@systec-electronic.com> you wrote: > Signed-off-by: Alexander Stein > --- > common/image.c | 11 ++++++++--- > 1 files changed, 8 insertions(+), 3 deletions(-) Why would this be needed? Do you have an error scenario? > + if (to <= from) > + { > + memmove (to, from, tail); > + to += tail; > + from += tail; > + } else { > + memmove (to + len - tail, from + len - tail, tail); In which way is this supposed to allow overlapping memory areas? Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de I think there's a world market for about five computers. -- attr. Thomas J. Watson (Chairman of the Board, IBM), 1943