mirror of
https://github.com/QuasarApp/zip.git
synced 2025-05-04 08:09:34 +00:00
Replace _wfopen_s by _wfopen, _wfreopen_s by _wfreopen (#176)
This commit is contained in:
parent
54af749c22
commit
f72dce22bd
13
src/miniz.h
13
src/miniz.h
@ -4125,11 +4125,10 @@ static wchar_t *str2wstr(const char *str) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static FILE *mz_fopen(const char *pFilename, const char *pMode) {
|
static FILE *mz_fopen(const char *pFilename, const char *pMode) {
|
||||||
FILE *pFile = NULL;
|
|
||||||
|
|
||||||
wchar_t *wFilename = str2wstr(pFilename);
|
wchar_t *wFilename = str2wstr(pFilename);
|
||||||
wchar_t *wMode = str2wstr(pMode);
|
wchar_t *wMode = str2wstr(pMode);
|
||||||
_wfopen_s(&pFile, wFilename, wMode);
|
FILE *pFile = _wfopen(wFilename, wMode);
|
||||||
|
|
||||||
free(wFilename);
|
free(wFilename);
|
||||||
free(wMode);
|
free(wMode);
|
||||||
|
|
||||||
@ -4137,17 +4136,13 @@ static FILE *mz_fopen(const char *pFilename, const char *pMode) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static FILE *mz_freopen(const char *pPath, const char *pMode, FILE *pStream) {
|
static FILE *mz_freopen(const char *pPath, const char *pMode, FILE *pStream) {
|
||||||
FILE *pFile = NULL;
|
|
||||||
|
|
||||||
wchar_t *wPath = str2wstr(pPath);
|
wchar_t *wPath = str2wstr(pPath);
|
||||||
wchar_t *wMode = str2wstr(pMode);
|
wchar_t *wMode = str2wstr(pMode);
|
||||||
int res = _wfreopen_s(&pFile, wPath, wMode, pStream);
|
FILE *pFile = _wfreopen(wPath, wMode, pStream);
|
||||||
|
|
||||||
free(wPath);
|
free(wPath);
|
||||||
free(wMode);
|
free(wMode);
|
||||||
|
|
||||||
if (res)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
return pFile;
|
return pFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user