Skip to content

Commit

Permalink
bug fix das2c_data for [-,R] to [C,R] expansion
Browse files Browse the repository at this point in the history
  • Loading branch information
cpiker committed Mar 16, 2020
1 parent 834f2b8 commit 0a81a99
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/das2c_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,16 @@ byte* das2c_memset(byte* pDest, const byte* pSrc, size_t uElemSz, size_t uCount)
memcpy(pDest, pSrc, uElemSz);
uDone = 1;

byte* pWrite = pDest;
while(uDone < uCount){

if(uDone > (uCount - uDone))
uWrite = uCount - uDone;
else
uWrite = uDone;

pWrite += uDone*uElemSz;

/* write from ourselves so that the amount of data written each time
goes as the square of the number of loops */
memcpy(pWrite, pDest, uElemSz*uWrite);
memcpy(pDest + uDone*uElemSz, pDest, uElemSz*uWrite);

uDone += uWrite;
}
Expand Down

0 comments on commit 0a81a99

Please sign in to comment.