On Fri, 2010-12-31, Ike Naar wrote:
> On 2010-12-31, Jorgen Grahn <grahn+> wrote:
>> On Thu, 2010-12-30, Ike Naar wrote:
>>> memcpy(tos, stac, tos-stac);
>>
>> I'm too lazy to read the whole original code, but remember that with
>> memcpy() the source and destination regions may not overlap.
>
> If you're too lazy to read the original code, then it's sufficient
> to look at the mempcy call, from which you can deduce that source
> and destination are adjacent and do not overlap.
> (the operation only makes sense if you assume that stac and tos
> are valid pointers into the same array and stac<=tos; these
> assumptions hold in the original code).
Well, I was too lazy to realize that too, but you're right of course.
/Jorgen
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
|