diff options
| author | Thomas Jarosch <tomj@simonv.com> | 2011-08-25 19:18:20 +0000 |
|---|---|---|
| committer | Thomas Jarosch <tomj@simonv.com> | 2011-08-25 19:18:20 +0000 |
| commit | 59b8c7816fde56a721dea6d25cf08d45e17e1ffd (patch) | |
| tree | 2de3a632f80ec854283f48d768737580158fefb9 /apps/plugins | |
| parent | 697aa7f4994651233bf5208877d58dbb1cec1974 (diff) | |
| download | rockbox-59b8c7816fde56a721dea6d25cf08d45e17e1ffd.zip rockbox-59b8c7816fde56a721dea6d25cf08d45e17e1ffd.tar.gz rockbox-59b8c7816fde56a721dea6d25cf08d45e17e1ffd.tar.bz2 rockbox-59b8c7816fde56a721dea6d25cf08d45e17e1ffd.tar.xz | |
Fix off-by-one memory corruption in resistor plugin.
I'm wondering if that also was the cause
for the lines exactly next to it:
---------------------------------
/* This cleans out the mysterious garbage that appears */
rb->lcd_clear_display();
---------------------------------
-> Atleast I see no garbage in the sim.
Credit for this bug goes to "cppcheck".
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30345 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
| -rw-r--r-- | apps/plugins/resistor.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/plugins/resistor.c b/apps/plugins/resistor.c index a0bd949..06d3bf9 100644 --- a/apps/plugins/resistor.c +++ b/apps/plugins/resistor.c @@ -801,8 +801,8 @@ static void resistance_to_color(void) enum color units_used = 0; char out_str[20]; - - for(i=0; i<=10; i++) { kbd_buffer[i] = 0; } + + memset(kbd_buffer,0,sizeof(kbd_buffer)); /* This cleans out the mysterious garbage that appears */ rb->lcd_clear_display(); rb->splash(HZ/2, "Resistance to Colour"); |