summaryrefslogtreecommitdiff
path: root/Bus/Ivy/Ivy.cxx
diff options
context:
space:
mode:
authorfcolin2007-02-01 12:56:20 +0000
committerfcolin2007-02-01 12:56:20 +0000
commiteed08b36250de1aca39abf7604557726dc8f686f (patch)
treed89c6da337399519442f99a3a2348762c5560274 /Bus/Ivy/Ivy.cxx
parenta36be931a326e24c6ff6ea557531bd92c2516091 (diff)
downloadivy-cplusplus-eed08b36250de1aca39abf7604557726dc8f686f.zip
ivy-cplusplus-eed08b36250de1aca39abf7604557726dc8f686f.tar.gz
ivy-cplusplus-eed08b36250de1aca39abf7604557726dc8f686f.tar.bz2
ivy-cplusplus-eed08b36250de1aca39abf7604557726dc8f686f.tar.xz
Utilisateur : Fcolin Date : 16/11/05 Heure : 9:54 Archivé dans $/Bus/Ivy Commentaire: 64 bits ports (vss 22)
Diffstat (limited to 'Bus/Ivy/Ivy.cxx')
-rw-r--r--Bus/Ivy/Ivy.cxx16
1 files changed, 12 insertions, 4 deletions
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;