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?

Memset corrupts memory?

From: Alex Gitelman <alex_at_fg-soup.com>
Date: Tue, 16 Jul 2002 22:49:12 -0700

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();
}
Received on 2002-07-17

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy