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



Rockbox mail archive

Subject: Memset corrupts memory?
From: Alex Gitelman (alex_at_fg-soup.com)
Date: 2002-07-17


After recent changes the following code crashes my recorder on file
read operation.
Reducing count in memset, say to 64 or removing memset altogether
allows it to run.
Crash consists of recorder showing some meaningless word (Stkov in my
case - always), HD ligh is on and it hangs.
/test.txt is a small (non empty file) I also tried with bigger files.
Best Regards
Alex

void app_main(void)
{
    init();

    {
    unsigned char out_buf[10000];
    int fd = open("/test.txt", O_RDONLY);
    if (fd<0)
       panicf("Can't open");
    memset(out_buf, 0x00, 5000);
    read(fd, out_buf, 64);
    close(fd);
    }

    browse_root();
}



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