mirror of
https://github.com/tomasriveral/NoteWrapper.git
synced 2026-08-12 02:18:38 +02:00
fix: bug available vaults written to wrong array
This commit is contained in:
+1
-1
@@ -134,7 +134,7 @@ char **getVaultsFromDirectories(char **directoryStringArray, int directoryNumber
|
|||||||
altDebug(" is a vault\n");
|
altDebug(" is a vault\n");
|
||||||
vaultsArray = realloc(vaultsArray, sizeof(vaultsArray) + sizeof(char *)); // resize vaultsArray
|
vaultsArray = realloc(vaultsArray, sizeof(vaultsArray) + sizeof(char *)); // resize vaultsArray
|
||||||
vaultsPerDirectoryNumber[i]++; // it will be used later to know which vaults goes into which directory
|
vaultsPerDirectoryNumber[i]++; // it will be used later to know which vaults goes into which directory
|
||||||
directoryStringArray[nthVault] = strdup(entryName); // we use strdup and not strcpy, because memory used with opendir and readdir will be closed.
|
vaultsArray[nthVault] = strdup(entryName); // we use strdup and not strcpy, because memory used with opendir and readdir will be closed.
|
||||||
nthVault++; // it is used immediatly to set the vault into directoryStringArray
|
nthVault++; // it is used immediatly to set the vault into directoryStringArray
|
||||||
} else {
|
} else {
|
||||||
altDebug(" is not a vault (not a dir.)\n");
|
altDebug(" is not a vault (not a dir.)\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user