CHDK code bug? - DryOS Development - CHDK Forum

CHDK code bug?

  • 3 Replies
  • 3482 Views
*

Offline emlyn

  • **
  • 88
CHDK code bug?
« on: 24 / October / 2010, 07:47:37 »
Advertisements
In the file core/conf.c, there is a line:
Code: [Select]
    CONF_INFO( 38, conf.reader_file,            CONF_DEF_PTR,   ptr:"A/README.TXT", conf_change_script_file),

But the conf_change_script_file function references conf.script_file, which is not set until later with:
Code: [Select]
    CONF_INFO(194, conf.script_file,            CONF_DEF_PTR,   ptr:"", conf_change_script_file),

Is this a bug? Should conf_change_script_file be replaced with NULL? Or am I misunderstanding something?

Emlyn

Re: CHDK code bug?
« Reply #1 on: 24 / October / 2010, 09:52:32 »
Seems to be a bug indeed. Probably undetected because conf.script_file is a static array initialised with zeros and script_load seems to interpret that as "load the default script."

*

Offline emlyn

  • **
  • 88
Re: CHDK code bug?
« Reply #2 on: 12 / November / 2010, 10:06:08 »
Seems to be a bug indeed. Probably undetected because conf.script_file is a static array initialised with zeros and script_load seems to interpret that as "load the default script."

OK, at the time I found it I had another bug that was preventing bss from being initialized, but I now see that it won't actually cause a problem.

*

Offline ultimA

  • ***
  • 137
Re: CHDK code bug?
« Reply #3 on: 12 / November / 2010, 10:24:42 »
I've found this one too and it was (very briefly) discussed at http://chdk.setepontos.com/index.php?topic=5793.0, everybody seems to agree that this is a bug.

I have patches on that thread which also fix this problem by replacing the callback for conf.reader_file with NULL.


 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal