Merge pull request #17828 from JoeOsborn/fix-uninitialized-variable

Fixes an uninitialized variable in extra wasmfs/fetchfs feature
This commit is contained in:
LibretroAdmin 2025-04-25 02:08:30 +02:00 committed by GitHub
commit 3ee6dd6481
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -628,7 +628,7 @@ static void platform_emscripten_mount_filesystems(void)
char *base_url = strdup(line);
base_url[strcspn(base_url, "\r\n")] = '\0'; // drop newline
base_url[len-1] = '\0'; // drop newline
backend_t fetch;
backend_t fetch = NULL;
len = max_line_len;
// Don't create fetch backend unless manifest actually has entries
while (getline(&line, &len, file) != -1)
@ -636,6 +636,10 @@ static void platform_emscripten_mount_filesystems(void)
if (!fetch)
{
fetch = wasmfs_create_fetch_backend(base_url, 16*1024*1024);
if(!fetch) {
printf("[FetchFS] couldn't create fetch backend for %s\n", base_url);
abort();
}
wasmfs_create_directory(fetch_base_dir, 0777, fetch);
}
char *realfs_path = strstr(line, " "), *url = line;