From d92d731fa51ccf56bda4ff9010d271b62f774bec Mon Sep 17 00:00:00 2001 From: Danny Smith Date: Mon, 22 Sep 2003 21:32:52 +0000 Subject: [PATCH] 2003-09-22 Roland Schwingel * mingwex/dirent.c (_topendir): Allocate enough memory for DIR struct in UNICODE case too. --- winsup/mingw/ChangeLog | 11 ++++++++--- winsup/mingw/mingwex/dirent.c | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog index 0692ecbd5..829ecf07a 100644 --- a/winsup/mingw/ChangeLog +++ b/winsup/mingw/ChangeLog @@ -1,3 +1,8 @@ +2003-09-22 Roland Schwingel + + * mingwex/dirent.c (_topendir): Allocate enough memory for + DIR struct in UNICODE case too. + 2003-09-15 Earnie Boyd * include/_mingw.h: Increment version to 3.2. @@ -888,10 +893,10 @@ (atexit): Force use of private atexit table via _dllonexit, (_onexit): New function. Force use of private atexit table via _dllonexit, - * mscvrt.def (atexit, _onexit): Add DATA keyword so that only + * msvcrt.def (atexit, _onexit): Add DATA keyword so that only _imp_<_symbol> is visible in import lib. - * mscvrt20.def: Likewise. - * mscvrt40.def: Likewise. + * msvcrt20.def: Likewise. + * msvcrt40.def: Likewise. * crtdll.def: Likewise. 2002-04-26 Danny Smith diff --git a/winsup/mingw/mingwex/dirent.c b/winsup/mingw/mingwex/dirent.c index 20d1921d7..e3c81e1b2 100644 --- a/winsup/mingw/mingwex/dirent.c +++ b/winsup/mingw/mingwex/dirent.c @@ -76,8 +76,8 @@ _topendir (const _TCHAR *szPath) /* Allocate enough space to store DIR structure and the complete * directory path given. */ - nd = (_TDIR *) malloc (sizeof (_TDIR) + _tcslen (szFullPath) + _tcslen (SLASH) + - _tcslen (SUFFIX)); + nd = (_TDIR *) malloc (sizeof (_TDIR) + (_tcslen(szFullPath) + _tcslen (SLASH) + + _tcslen(SUFFIX) + 1) * sizeof(_TCHAR)); if (!nd) {