summaryrefslogtreecommitdiff
path: root/Ivy
diff options
context:
space:
mode:
authorfcolin2007-02-01 12:56:20 +0000
committerfcolin2007-02-01 12:56:20 +0000
commit875e598e3e1b09ee41a3aeaefc3b8bc78ac68d48 (patch)
tree39a917330b8de4bb86b5b942f6849de967692e56 /Ivy
parente2773f2d3c326d4492311332cedbc33dc71d9205 (diff)
downloadivy-cplusplus-875e598e3e1b09ee41a3aeaefc3b8bc78ac68d48.zip
ivy-cplusplus-875e598e3e1b09ee41a3aeaefc3b8bc78ac68d48.tar.gz
ivy-cplusplus-875e598e3e1b09ee41a3aeaefc3b8bc78ac68d48.tar.bz2
ivy-cplusplus-875e598e3e1b09ee41a3aeaefc3b8bc78ac68d48.tar.xz
Utilisateur : Fcolin Date : 16/11/05 Heure : 9:54 Archivé dans $/Bus/Ivy Commentaire: 64 bits ports (vss 22)
Diffstat (limited to 'Ivy')
-rw-r--r--Ivy/Ivy.cxx16
1 files changed, 12 insertions, 4 deletions
diff --git a/Ivy/Ivy.cxx b/Ivy/Ivy.cxx
index c70d23f..daa2129 100644
--- a/Ivy/Ivy.cxx
+++ b/Ivy/Ivy.cxx
@@ -89,9 +89,17 @@ const char * Ivy::GetDomain(const char *domainlist)
if ( domain.empty() )
{
#ifndef UNDER_CE
- const char *env = getenv ( "IVYBUS" );
- if ( env )
+ size_t requiredSize;
+
+ getenv_s( &requiredSize, NULL, 0, "IVYBUS");
+
+ if ( requiredSize )
+ {
+ char *env = (char*)malloc( requiredSize * sizeof(char));
+ getenv_s( &requiredSize, env, requiredSize, "IVYBUS");
domain = env;
+ free( env );
+ }
#endif
if ( domain.empty() )
domain = DEFAULT_DOMAIN;
@@ -148,7 +156,7 @@ int Ivy::BindMsg( IvyMessageCallback *cb, const char *regexp, ... )
va_list args;
va_start( args, regexp ); /* Initialize variable arguments. */
- _vsnprintf( buffer, sizeof(buffer), regexp, args );
+ _vsnprintf_s( buffer, sizeof(buffer), sizeof(buffer)-1, regexp, args );
va_end( args);
regexp_out.push_back( regexp );
@@ -243,7 +251,7 @@ int Ivy::SendMsg(const char * message, ... )
va_list args;
va_start( args, message ); /* Initialize variable arguments. */
- _vsnprintf( buffer, sizeof(buffer), message, args );
+ _vsnprintf_s( buffer, sizeof(buffer), sizeof(buffer)-1, message, args );
va_end( args);
/* send to already connected */
IvyApplicationList::iterator iter;