From eed08b36250de1aca39abf7604557726dc8f686f Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 1 Feb 2007 12:56:20 +0000 Subject: Utilisateur : Fcolin Date : 16/11/05 Heure : 9:54 Archivé dans $/Bus/Ivy Commentaire: 64 bits ports (vss 22) --- Bus/Ivy/Ivy.cxx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'Bus/Ivy') diff --git a/Bus/Ivy/Ivy.cxx b/Bus/Ivy/Ivy.cxx index c70d23f..daa2129 100644 --- a/Bus/Ivy/Ivy.cxx +++ b/Bus/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; -- cgit v1.1