Let me say that I wholeheartedly agree. I wrote it more as a joke rather
then a practical solution (didn't you notice :) in the end?). And I also
concur that malloc() call must be checked. I missed it :/ and should've
caught it right away.
Regards,
--
Timour Ezeev
Pivotal Dynamics
timour@pivotaldynamics.com
V: 305.406.9904
F: 305.406.9689
On Wed, 27 Oct 2004, Diane Bruce wrote:
> On Wed, Oct 27, 2004 at 12:51:51PM -0400, Timour Ezeev wrote:
>>
> ...
>> (int)tmp_cp ^= (int)cp; (int)cp ^= (int)tmp_cp; (int)tmp_cp ^=
>> (int)cp;
>> free(tmp_cp);
>
> I'd fire any coder working for me that wrote that.
>
> You are worried about what? about up to 10 bytes that gets lost
> from malloc for the life of this program? Good grief. I'd be slightly
> more worried about you not checking for a NULL result from malloc().
>
> - Diane
>