Using memset or other way in sal/osl/unx/security.c

julien2412 serval2412 at yahoo.fr
Mon Dec 24 06:59:14 PST 2012


Hello,

In sal/osl/unx/security.c, I noticed these:
    278 sal_Bool SAL_CALL osl_getHomeDir(oslSecurity Security, rtl_uString
**pustrDirectory)
    279 {
    280     sal_Bool bRet=sal_False;
    281     sal_Char pszDirectory[PATH_MAX];
    282 
    283     pszDirectory[0] = '\0';

    373 sal_Bool SAL_CALL osl_getConfigDir(oslSecurity Security, rtl_uString
**pustrDirectory)
    374 {
    375     sal_Bool bRet = sal_False;
    376     sal_Char pszDirectory[PATH_MAX];
    377 
    378     pszDirectory[0] = '\0';

I'm not sure but I think it doesn't put the rest of the array to 0.
Would memsetting to 0 the whole array be right (and possibly useful)?
What about this too ?
sal_Char pszDirectory[PATH_MAX] = ""; 
It compiles but I wonder if it would be ok for every env

Julien




--
View this message in context: http://nabble.documentfoundation.org/Using-memset-or-other-way-in-sal-osl-unx-security-c-tp4026020.html
Sent from the Dev mailing list archive at Nabble.com.


More information about the LibreOffice mailing list