Damjan Jovanovic : msvcrt: The time passed to utime functions can be NULL.
Alexandre Julliard
julliard at winehq.org
Mon Jun 20 14:24:08 CDT 2011
Module: wine
Branch: master
Commit: c28baa7b96aaf721478ef6899181d3133607c9dc
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c28baa7b96aaf721478ef6899181d3133607c9dc
Author: Damjan Jovanovic <damjan.jov at gmail.com>
Date: Mon Jun 20 06:27:41 2011 +0200
msvcrt: The time passed to utime functions can be NULL.
---
dlls/msvcrt/file.c | 39 +++++++++++++++++++++++++++------------
1 files changed, 27 insertions(+), 12 deletions(-)
diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c
index b3d1ddc..385771e 100644
--- a/dlls/msvcrt/file.c
+++ b/dlls/msvcrt/file.c
@@ -1477,10 +1477,15 @@ int CDECL _futime64(int fd, struct MSVCRT___utimbuf64 *t)
*/
int CDECL _futime32(int fd, struct MSVCRT___utimbuf32 *t)
{
- struct MSVCRT___utimbuf64 t64;
- t64.actime = t->actime;
- t64.modtime = t->modtime;
- return _futime64( fd, &t64 );
+ if (t)
+ {
+ struct MSVCRT___utimbuf64 t64;
+ t64.actime = t->actime;
+ t64.modtime = t->modtime;
+ return _futime64( fd, &t64 );
+ }
+ else
+ return _futime64( fd, NULL );
}
/*********************************************************************
@@ -2402,10 +2407,15 @@ int CDECL _utime64(const char* path, struct MSVCRT___utimbuf64 *t)
*/
int CDECL _utime32(const char* path, struct MSVCRT___utimbuf32 *t)
{
- struct MSVCRT___utimbuf64 t64;
- t64.actime = t->actime;
- t64.modtime = t->modtime;
- return _utime64( path, &t64 );
+ if (t)
+ {
+ struct MSVCRT___utimbuf64 t64;
+ t64.actime = t->actime;
+ t64.modtime = t->modtime;
+ return _utime64( path, &t64 );
+ }
+ else
+ return _utime64( path, NULL );
}
/*********************************************************************
@@ -2444,10 +2454,15 @@ int CDECL _wutime64(const MSVCRT_wchar_t* path, struct MSVCRT___utimbuf64 *t)
*/
int CDECL _wutime32(const MSVCRT_wchar_t* path, struct MSVCRT___utimbuf32 *t)
{
- struct MSVCRT___utimbuf64 t64;
- t64.actime = t->actime;
- t64.modtime = t->modtime;
- return _wutime64( path, &t64 );
+ if (t)
+ {
+ struct MSVCRT___utimbuf64 t64;
+ t64.actime = t->actime;
+ t64.modtime = t->modtime;
+ return _wutime64( path, &t64 );
+ }
+ else
+ return _wutime64( path, NULL );
}
/*********************************************************************
More information about the wine-cvs
mailing list