Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: backlight.c, being anal about
From: TP Diffenbach (rockbox_at_diffenbach.org)
Date: 2003-07-27


In backlight.c, backlight_set_timeout takes an int named seconds (line 128):

void backlight_set_timeout(int seconds)
{
    backlight_timeout = seconds;
    backlight_on();
}

and doesn't check its value.

But it uses that value as an index in a 19 element array (line 66):

backlight_timer = HZ*backlight_timeout_value[backlight_timeout];

I suspect this is only being called from the config and settings code, but it
still seems like a place where the code could be written more defensively (with an
enum rather than an int, or a sanity check of the value).

-- 
Archos FM has a Rockbox!



Page was last modified "Jan 10 2012" The Rockbox Crew
aaa