memset a buffer to 0, to avoid Solaris UMR diagnostics.

This commit is contained in:
mcmullen%netscape.com 1999-04-06 20:10:50 +00:00
Родитель 2f9527c569
Коммит 75e878b3a9
2 изменённых файлов: 10 добавлений и 2 удалений

Просмотреть файл

@ -55,7 +55,7 @@
extern "C" int statvfs(const char *, struct statvfs *);
#endif
//----------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------
void nsFileSpecHelpers::Canonify(nsSimpleCharString& ioPath, PRBool inMakeDirs)
// Canonify, make absolute, and check whether directories exist
//----------------------------------------------------------------------------------------
@ -69,7 +69,11 @@ void nsFileSpecHelpers::Canonify(nsSimpleCharString& ioPath, PRBool inMakeDirs)
}
char buffer[MAXPATHLEN];
errno = 0;
#if defined(SOLARIS)
memset(buffer, '\0', sizeof(buffer)); // realpath reads it all, initialized or not.
#else
*buffer = '\0';
#endif
char* canonicalPath = realpath((const char*)ioPath, buffer);
if (!canonicalPath)
{

Просмотреть файл

@ -55,7 +55,7 @@
extern "C" int statvfs(const char *, struct statvfs *);
#endif
//----------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------
void nsFileSpecHelpers::Canonify(nsSimpleCharString& ioPath, PRBool inMakeDirs)
// Canonify, make absolute, and check whether directories exist
//----------------------------------------------------------------------------------------
@ -69,7 +69,11 @@ void nsFileSpecHelpers::Canonify(nsSimpleCharString& ioPath, PRBool inMakeDirs)
}
char buffer[MAXPATHLEN];
errno = 0;
#if defined(SOLARIS)
memset(buffer, '\0', sizeof(buffer)); // realpath reads it all, initialized or not.
#else
*buffer = '\0';
#endif
char* canonicalPath = realpath((const char*)ioPath, buffer);
if (!canonicalPath)
{