AcessNative - Fixing Fixing Fixing
[tpg/acess2.git] / Kernel / adt.c
index 7a23834..0f116f3 100644 (file)
@@ -22,12 +22,13 @@ size_t RingBuffer_Read(void *Dest, tRingBuffer *Buffer, size_t Length)
        {
                 int    endData = Buffer->Space - Buffer->Start;
                memcpy(Dest, &Buffer->Data[Buffer->Start], endData);
-               memcpy(Dest + endData, &Buffer->Data, Length - endData);
+               memcpy((Uint8*)Dest + endData, &Buffer->Data, Length - endData);
        }
        else
        {
                memcpy(Dest, &Buffer->Data[Buffer->Start], Length);
        }
+       Buffer->Start += Length;
        Buffer->Length -= Length;
        return Length;
 }
@@ -44,7 +45,7 @@ size_t RingBuffer_Write(tRingBuffer *Buffer, void *Source, size_t Length)
        if(endSpace < Length)
        {
                memcpy( &Buffer->Data[bufEnd], Source, endSpace );
-               memcpy( Buffer->Data, Source + endSpace, Length - endSpace );
+               memcpy( Buffer->Data, (Uint8*)Source + endSpace, Length - endSpace );
                Buffer->Length = Length - endSpace;
        }
        else

UCC git Repository :: git.ucc.asn.au