From 0a81a9995ad958b6309ee5b94497317c92ca4d38 Mon Sep 17 00:00:00 2001 From: cpiker Date: Mon, 16 Mar 2020 03:03:23 -0500 Subject: [PATCH] bug fix das2c_data for [-,R] to [C,R] expansion --- src/das2c_data.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/das2c_data.c b/src/das2c_data.c index 42ac09c..c073584 100644 --- a/src/das2c_data.c +++ b/src/das2c_data.c @@ -76,7 +76,6 @@ 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)) @@ -84,11 +83,9 @@ byte* das2c_memset(byte* pDest, const byte* pSrc, size_t uElemSz, size_t uCount) 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; }