From a05057c74479d2a5fa00a9d89a9bc64992ae3233 Mon Sep 17 00:00:00 2001 From: "mcmullen%netscape.com" Date: Tue, 6 Apr 1999 20:10:50 +0000 Subject: [PATCH] memset a buffer to 0, to avoid Solaris UMR diagnostics. git-svn-id: svn://10.0.0.236/trunk@26510 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/base/src/unix/nsFileSpecUnix.cpp | 6 +++++- mozilla/xpcom/io/nsFileSpecUnix.cpp | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/mozilla/base/src/unix/nsFileSpecUnix.cpp b/mozilla/base/src/unix/nsFileSpecUnix.cpp index dab41c97758..3d14e58b140 100644 --- a/mozilla/base/src/unix/nsFileSpecUnix.cpp +++ b/mozilla/base/src/unix/nsFileSpecUnix.cpp @@ -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) { diff --git a/mozilla/xpcom/io/nsFileSpecUnix.cpp b/mozilla/xpcom/io/nsFileSpecUnix.cpp index dab41c97758..3d14e58b140 100644 --- a/mozilla/xpcom/io/nsFileSpecUnix.cpp +++ b/mozilla/xpcom/io/nsFileSpecUnix.cpp @@ -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) {