Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!sdrc!thor!scjones From: scjones@thor.UUCP (Larry Jones) Newsgroups: comp.std.c Subject: Re: memcpy Keywords: memcpy Message-ID: <187@thor.UUCP> Date: 21 Sep 90 13:19:29 GMT References: <1990Sep19.021418.11574@maths.tcd.ie> Organization: SDRC, Cincinnati Lines: 21 In article <1990Sep19.021418.11574@maths.tcd.ie>, tim@maths.tcd.ie (Timothy Murphy) writes: > Recently, while debugging the Unix version of unzip.c, > I found a surprising discrepancy between 'memcpy' on various machines. > > In unzip.c it is assumed that the effect of > buf[0] = c; > memcpy(buf+1, buf, 20); > is to set > buf[0] = buf[1] = buf[2] = ... = buf[21] = c. This is a bug in unzip which is why almost every system required using the version of memcpy that came with unzip instead of the one in the standard library. It has been fixed. Note that unzip is inusual in that it wants the DESCTRUCTIVE effect when the areas overlap where most code wants the NON-DESCTRUCTIVE effect. ---- Larry Jones UUCP: uunet!sdrc!thor!scjones SDRC scjones@thor.UUCP 2000 Eastman Dr. BIX: ltl Milford, OH 45150-2789 AT&T: (513) 576-2070 Life's a lot more fun when you're not responsible for your actions. -- Calvin