summaryrefslogtreecommitdiff
path: root/sal/osl/unx/profile.c
diff options
context:
space:
mode:
authormfe <mfe@openoffice.org>2000-12-06 15:03:16 +0000
committermfe <mfe@openoffice.org>2000-12-06 15:03:16 +0000
commite73d5c871e382846e65f2093a907eac41ef8ed4d (patch)
tree2e90f84b495ca8ebf7cadda17a527c83ff152ac9 /sal/osl/unx/profile.c
parent49909d21d653a5f49122b8ff7639346936a7b808 (diff)
#81439# : removed static buffer in writing
Diffstat (limited to 'sal/osl/unx/profile.c')
-rw-r--r--sal/osl/unx/profile.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/sal/osl/unx/profile.c b/sal/osl/unx/profile.c
index fc2e190b8e72..caae20994ada 100644
--- a/sal/osl/unx/profile.c
+++ b/sal/osl/unx/profile.c
@@ -2,9 +2,9 @@
*
* $RCSfile: profile.c,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: mfe $ $Date: 2000-11-01 14:36:10 $
+ * last change: $Author: mfe $ $Date: 2000-12-06 16:03:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -65,6 +65,7 @@
#include <osl/diagnose.h>
#include <osl/profile.h>
#include <osl/process.h>
+#include <osl/thread.h>
#include <rtl/alloc.h>
#include <osl/util.h>
@@ -655,7 +656,7 @@ sal_Bool SAL_CALL osl_readProfileString(oslProfile Profile,
}
else
{
- pStr=pszDefault;
+ pStr=(sal_Char*)pszDefault;
}
if ( pStr != 0 )
@@ -764,7 +765,7 @@ sal_Bool SAL_CALL osl_writeProfileString(oslProfile Profile,
sal_Bool bRet = sal_False;
sal_uInt32 NoEntry;
sal_Char* pStr;
- sal_Char Line[1024] = "";
+ sal_Char* Line = 0;
osl_TProfileSection* pSec;
osl_TProfileImpl* pProfile = 0;
osl_TProfileImpl* pTmpProfile = 0;
@@ -806,6 +807,7 @@ sal_Bool SAL_CALL osl_writeProfileString(oslProfile Profile,
return (sal_False);
}
+ Line = (sal_Char*) malloc(strlen(pszEntry)+strlen(pszString)+48);
if (! (pProfile->m_Flags & osl_Profile_SYSTEM))
{
@@ -827,6 +829,8 @@ sal_Bool SAL_CALL osl_writeProfileString(oslProfile Profile,
pthread_mutex_unlock(&(pTmpProfile->m_AccessLock));
+ free(Line);
+
#ifdef TRACE_OSL_PROFILE
OSL_TRACE("Out osl_writeProfileString [not added]\n");
#endif
@@ -856,6 +860,7 @@ sal_Bool SAL_CALL osl_writeProfileString(oslProfile Profile,
OSL_ASSERT(bRet);
pthread_mutex_unlock(&(pTmpProfile->m_AccessLock));
+ free(Line);
#ifdef TRACE_OSL_PROFILE
OSL_TRACE("Out osl_writeProfileString [not inserted]\n");
@@ -883,6 +888,10 @@ sal_Bool SAL_CALL osl_writeProfileString(oslProfile Profile,
OSL_ASSERT(bRet);
pthread_mutex_unlock(&(pTmpProfile->m_AccessLock));
+ if ( Line!= 0 )
+ {
+ free(Line);
+ }
#ifdef TRACE_OSL_PROFILE
OSL_TRACE("Out osl_writeProfileString [ok]\n");