X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/Ventoy.git/blobdiff_plain/293f677cbfbaae984fc3063c62d4b9afa0067520..6b22a6200e8f72d3260d292800a8786666623bfc:/Plugson/src/Core/ventoy_util.c diff --git a/Plugson/src/Core/ventoy_util.c b/Plugson/src/Core/ventoy_util.c index d6ce010..2a00433 100644 --- a/Plugson/src/Core/ventoy_util.c +++ b/Plugson/src/Core/ventoy_util.c @@ -80,44 +80,6 @@ uint64_t ventoy_get_human_readable_gb(uint64_t SizeBytes) return (uint64_t)GB; } -int ventoy_read_file_to_buf(const char *FileName, int ExtLen, void **Bufer, int *BufLen) -{ - int FileSize; - FILE *fp = NULL; - void *Data = NULL; - -#if defined(_MSC_VER) || defined(WIN32) - fopen_s(&fp, FileName, "rb"); -#else - fp = fopen(FileName, "rb"); -#endif - if (fp == NULL) - { - vlog("Failed to open file %s", FileName); - return 1; - } - - fseek(fp, 0, SEEK_END); - FileSize = (int)ftell(fp); - - Data = malloc(FileSize + ExtLen); - if (!Data) - { - fclose(fp); - return 1; - } - - fseek(fp, 0, SEEK_SET); - fread(Data, 1, FileSize, fp); - - fclose(fp); - - *Bufer = Data; - *BufLen = FileSize; - - return 0; -} - ventoy_file * ventoy_tar_find_file(const char *path) { int i; @@ -211,6 +173,7 @@ int ventoy_www_init(void) if (ventoy_decompress_tar(g_tar_buffer, TAR_BUF_MAX, &tarsize)) { + vlog("Failed to decompress tar\n"); return 1; }