More fixes
This commit is contained in:
parent
04d7e24565
commit
722d9b98af
@ -494,8 +494,7 @@ bool menuEntryLoad(menuEntry_s* me, const char* name, bool shortcut) {
|
||||
strptr = getSlash(me->path);
|
||||
if (strptr[0] == '/') strptr++;
|
||||
int strptrLen = strlen(strptr);
|
||||
snprintf(tempbuf, sizeof(tempbuf)-1, "%.*s.%.*s.star", (int)(strlen(me->path) - strptrLen), me->path, (int)strptrLen, strptr);
|
||||
strcpy(me->starpath, tempbuf);
|
||||
snprintf(me->starpath, sizeof(me->starpath)-1, "%.*s.%.*s.star", (int)(strlen(me->path) - strptrLen), me->path, (int)strptrLen, strptr);
|
||||
me->starred = fileExists(me->starpath);
|
||||
|
||||
return true;
|
||||
|
@ -101,7 +101,10 @@ static void menuSort(void) {
|
||||
menuEntry_s** list = (menuEntry_s**)calloc(nEntries, sizeof(menuEntry_s*));
|
||||
if(list == NULL) return;
|
||||
menuEntry_s** listStar = (menuEntry_s**)calloc(nEntries, sizeof(menuEntry_s*));
|
||||
if(listStar == NULL) return;
|
||||
if(listStar == NULL) {
|
||||
free(list);
|
||||
return;
|
||||
}
|
||||
|
||||
menuEntry_s* p = m->firstEntry;
|
||||
for(i = 0; i < nEntries; ++i) {
|
||||
|
@ -38,7 +38,7 @@ void toggleStarState(menuEntry_s* arg) {
|
||||
} else {
|
||||
if (!fileExists(me->starpath)) {
|
||||
FILE* f = fopen(me->starpath, "w");
|
||||
fclose(f);
|
||||
if (f) fclose(f);
|
||||
}
|
||||
}
|
||||
me->starred = fileExists(me->starpath);
|
||||
|
Loading…
Reference in New Issue
Block a user