From 59af2e27198017cec262af12ba4c90161b4c6e08 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Wed, 19 Feb 2014 15:22:36 +0100 Subject: [PATCH 1/2] Valgrind detected a value tested, not initialized --- .gitignore | 2 +- radio/src/gui/menus.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 541e88799..fd92abe27 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -/.project +/.*project /.settings diff --git a/radio/src/gui/menus.cpp b/radio/src/gui/menus.cpp index 5bdbeb484..b760f3e22 100644 --- a/radio/src/gui/menus.cpp +++ b/radio/src/gui/menus.cpp @@ -778,7 +778,7 @@ bool check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t vertpos_t realPgOfs = s_pgOfs; vertpos_t realMaxrow = maxrow; for (vertpos_t i=1; i<=maxrow; i++) { - if (horTab[i] == HIDDEN_ROW) { + if (MAXCOL_RAW(i) == HIDDEN_ROW) { realMaxrow--; if (i < l_posVert) realPosVert--; @@ -790,7 +790,7 @@ bool check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t else if (realPosVert<1+realPgOfs) realPgOfs = realPosVert-1; s_pgOfs = realPgOfs; for (vertpos_t i=1; i<=realPgOfs; i++) { - if (horTab[i] == HIDDEN_ROW) { + if (MAXCOL_RAW(i) == HIDDEN_ROW) { s_pgOfs++; } } From 3340a184613daafdc2260be4ff883d8a30b10220 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Wed, 19 Feb 2014 15:23:13 +0100 Subject: [PATCH 2/2] Fix for simu running on VirtualBox mounted directories --- radio/src/simpgmspace.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/radio/src/simpgmspace.cpp b/radio/src/simpgmspace.cpp index cd3fb4803..a60143dda 100644 --- a/radio/src/simpgmspace.cpp +++ b/radio/src/simpgmspace.cpp @@ -550,9 +550,11 @@ FRESULT f_readdir (DIR * rep, FILINFO * fil) fil->fattrib = (ent->d_type == DT_DIR ? AM_DIR : 0); #else if (ent->d_type == simu::DT_UNKNOWN) { + fil->fattrib = 0; struct stat buf; - lstat(ent->d_name, &buf); - fil->fattrib = (S_ISDIR(buf.st_mode) ? AM_DIR : 0); + if (stat(ent->d_name, &buf) == 0) { + fil->fattrib = (S_ISDIR(buf.st_mode) ? AM_DIR : 0); + } } else { fil->fattrib = (ent->d_type == simu::DT_DIR ? AM_DIR : 0); @@ -563,6 +565,7 @@ FRESULT f_readdir (DIR * rep, FILINFO * fil) memset(fil->lfname, 0, SD_SCREEN_FILE_LENGTH); strncpy(fil->fname, ent->d_name, 13-1); strcpy(fil->lfname, ent->d_name); + // TRACE("f_readdir(): %s", fil->fname); return FR_OK; }