muscle: Initialize variables and check return codes

This commit is contained in:
Jakub Jelen 2019-11-14 13:05:47 +01:00 committed by Frank Morgner
parent 7360c4bf0c
commit 1594b1167d
1 changed files with 6 additions and 3 deletions

View File

@ -207,10 +207,13 @@ int mscfs_check_selection(mscfs_t *fs, int requiredItem)
int mscfs_loadFileInfo(mscfs_t* fs, const u8 *path, int pathlen, mscfs_file_t **file_data, int* idx)
{
msc_id fullPath;
int x;
msc_id fullPath = {{0, 0, 0, 0}};
int x, rc;
assert(fs != NULL && path != NULL && file_data != NULL);
mscfs_lookup_path(fs, path, pathlen, &fullPath, 0);
rc = mscfs_lookup_path(fs, path, pathlen, &fullPath, 0);
if (rc != SC_SUCCESS) {
return rc;
}
/* Obtain file information while checking if it exists */
mscfs_check_cache(fs);