Changeset 19367

Show
Ignore:
Timestamp:
10/01/06 17:00:05 (2 years ago)
Author:
patrick
Message:

Avoid attempts to dereference a null pointer in the std::string constructor
when an environment variable isn't set.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • juggler/trunk/modules/sonix/plugins/AudioWorks/AudioWorksSoundImplementation.cpp

    r18824 r19367  
    4646#include <gmtl/Xforms.h> 
    4747 
     48#include <vpr/vpr.h> 
     49#include <vpr/System.h> 
    4850#include <vpr/Util/Assert.h> 
    4951#include <vpr/Util/Debug.h> 
     
    369371   { 
    370372      // figure out what host to connect to if any: 
    371       std::string hostname = getenv( "SNX_AW_HOSTNAME" ); 
     373      std::string hostname; 
     374      vpr::System::getenv("SNX_AW_HOSTNAME", hostname); 
    372375 
    373376      // if no hostname set, then look for an rc file 
     
    375378      { 
    376379         hostname = "localhost"; 
    377          std::string rc_filepath = getenv( "HOME" ); 
     380         vpr::System::getenv("HOME", rc_filepath); 
    378381         rc_filepath += "/.sonix-aw"; 
    379382         vpr::DebugOutputGuard output1(snxDBG, vprDBG_CONFIG_LVL, std::string("AudioWorks| Reading "+rc_filepath+" for hostname"), std::string("\n"));