Re: [cc65] Think I found a cc65 bug

Date view Thread view Subject view

From: Ullrich von Bassewitz (uz_at_musoftware.de)
Date: 2002-12-03 18:58:01


On Tue, Dec 03, 2002 at 06:35:13PM +0100, MagerValp wrote:
> Sorry, I forgot to mention that I'm testing with 2.8.0. I'll test with
> the latest snapshot when I'm at home.

Before doing any more tests, I would suggest to fix the following bugs in your
program:

------------------------------------------------------------------------
Line 139:

old:    if ((menu = malloc(sizeof(menu))) == NULL) {
          return(NULL);
        }
new:    if ((menu = malloc(sizeof(*menu))) == NULL) {
          return(NULL);
        }
------------------------------------------------------------------------
Line 165:

old:    if ((menu->firstitem = malloc(sizeof(item))) == NULL) {
          return(-1);
        }
new:    if ((menu->firstitem = malloc(sizeof(*item))) == NULL) {
          return(-1);
        }
------------------------------------------------------------------------
Line 178:

old:    if ((item->next = malloc(sizeof(item))) == NULL) {
          return(-1);
        }
new:    if ((item->next = malloc(sizeof(*item))) == NULL) {
          return(-1);
        }
------------------------------------------------------------------------

I'm pretty sure these changes will help. You owe me a beer now:-)

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz_at_musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2002-12-03 18:58:12 CET