2021-07-24 00:02:46 +08:00
|
|
|
diff --git a/dgif_lib.c b/dgif_lib.c
|
|
|
|
index 82fc097..3bb302b 100644
|
|
|
|
--- a/dgif_lib.c
|
|
|
|
+++ b/dgif_lib.c
|
|
|
|
@@ -58,7 +58,7 @@ DGifOpenFileName(const char *FileName, int *Error)
|
2019-03-29 05:46:21 +08:00
|
|
|
int FileHandle;
|
|
|
|
GifFileType *GifFile;
|
|
|
|
|
|
|
|
- if ((FileHandle = open(FileName, O_RDONLY)) == -1) {
|
|
|
|
+ if ((FileHandle = _open(FileName, O_RDONLY)) == -1) {
|
|
|
|
if (Error != NULL)
|
|
|
|
*Error = D_GIF_ERR_OPEN_FAILED;
|
|
|
|
return NULL;
|
2021-07-24 00:02:46 +08:00
|
|
|
@@ -85,7 +85,7 @@ DGifOpenFileHandle(int FileHandle, int *Error)
|
2019-03-29 05:46:21 +08:00
|
|
|
if (GifFile == NULL) {
|
|
|
|
if (Error != NULL)
|
|
|
|
*Error = D_GIF_ERR_NOT_ENOUGH_MEM;
|
|
|
|
- (void)close(FileHandle);
|
|
|
|
+ (void)_close(FileHandle);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2021-07-24 00:02:46 +08:00
|
|
|
@@ -99,7 +99,7 @@ DGifOpenFileHandle(int FileHandle, int *Error)
|
2019-03-29 05:46:21 +08:00
|
|
|
if (Private == NULL) {
|
|
|
|
if (Error != NULL)
|
|
|
|
*Error = D_GIF_ERR_NOT_ENOUGH_MEM;
|
|
|
|
- (void)close(FileHandle);
|
|
|
|
+ (void)_close(FileHandle);
|
|
|
|
free((char *)GifFile);
|
|
|
|
return NULL;
|
|
|
|
}
|
2021-07-24 00:02:46 +08:00
|
|
|
@@ -110,7 +110,7 @@ DGifOpenFileHandle(int FileHandle, int *Error)
|
2019-03-29 05:46:21 +08:00
|
|
|
_setmode(FileHandle, O_BINARY); /* Make sure it is in binary mode. */
|
|
|
|
#endif /* _WIN32 */
|
|
|
|
|
|
|
|
- f = fdopen(FileHandle, "rb"); /* Make it into a stream: */
|
|
|
|
+ f = _fdopen(FileHandle, "rb"); /* Make it into a stream: */
|
|
|
|
|
|
|
|
/*@-mustfreeonly@*/
|
|
|
|
GifFile->Private = (void *)Private;
|
2021-07-24 00:02:46 +08:00
|
|
|
diff --git a/egif_lib.c b/egif_lib.c
|
|
|
|
index 6219af0..8ddda1b 100644
|
|
|
|
--- a/egif_lib.c
|
|
|
|
+++ b/egif_lib.c
|
|
|
|
@@ -67,10 +67,10 @@ EGifOpenFileName(const char *FileName, const bool TestExistence, int *Error)
|
2019-03-29 05:46:21 +08:00
|
|
|
GifFileType *GifFile;
|
|
|
|
|
|
|
|
if (TestExistence)
|
|
|
|
- FileHandle = open(FileName, O_WRONLY | O_CREAT | O_EXCL,
|
|
|
|
+ FileHandle = _open(FileName, O_WRONLY | O_CREAT | O_EXCL,
|
|
|
|
S_IREAD | S_IWRITE);
|
|
|
|
else
|
|
|
|
- FileHandle = open(FileName, O_WRONLY | O_CREAT | O_TRUNC,
|
|
|
|
+ FileHandle = _open(FileName, O_WRONLY | O_CREAT | O_TRUNC,
|
|
|
|
S_IREAD | S_IWRITE);
|
|
|
|
|
|
|
|
if (FileHandle == -1) {
|
2021-07-24 00:02:46 +08:00
|
|
|
@@ -80,7 +80,7 @@ EGifOpenFileName(const char *FileName, const bool TestExistence, int *Error)
|
2019-03-29 05:46:21 +08:00
|
|
|
}
|
|
|
|
GifFile = EGifOpenFileHandle(FileHandle, Error);
|
|
|
|
if (GifFile == (GifFileType *) NULL)
|
|
|
|
- (void)close(FileHandle);
|
|
|
|
+ (void)_close(FileHandle);
|
|
|
|
return GifFile;
|
|
|
|
}
|
|
|
|
|
2021-07-24 00:02:46 +08:00
|
|
|
@@ -125,7 +125,7 @@ EGifOpenFileHandle(const int FileHandle, int *Error)
|
2019-03-29 05:46:21 +08:00
|
|
|
_setmode(FileHandle, O_BINARY); /* Make sure it is in binary mode. */
|
|
|
|
#endif /* _WIN32 */
|
|
|
|
|
|
|
|
- f = fdopen(FileHandle, "wb"); /* Make it into a stream: */
|
|
|
|
+ f = _fdopen(FileHandle, "wb"); /* Make it into a stream: */
|
|
|
|
|
|
|
|
GifFile->Private = (void *)Private;
|
|
|
|
Private->FileHandle = FileHandle;
|