Re: [cc65] Why crashing attempting to free this struct?

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2012-03-26 20:58:48
On Mon, Mar 26, 2012 at 01:31:48PM -0500, Payton Byrd wrote:
>    Found and fixed the problem in the above code.  There is no return
>    statement in this function, so the return value was random memory
>    locations  which meant code was getting overwritten.  Is there not
>    supposed to be a warning or error generated in such a scenario?

I get 

        test.c(43): Warning: Control reaches end of non-void function

when trying to compile the code. Apart from that I would not hardcode the size
of the "name" field (17) in cbm_direntry and instead use sizeof. Your code
will break if the header file changes.

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz@musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Mon Mar 26 20:59:04 2012

This archive was generated by hypermail 2.1.8 : 2012-03-26 20:59:07 CEST