Changeset 5754:b23d79c13370 in roaraudio for libroaross


Ignore:
Timestamp:
11/16/12 16:49:56 (11 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

avoid getenv() and use more portable roar_env_get(). Also improved security as we enfore const now on bufferes obtained from the env.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroaross/libroaross.c

    r5543 r5754  
    382382} 
    383383 
    384 static struct session * _open_session (char * server, char * name) { 
     384static struct session * _open_session (const char * server, const char * name) { 
    385385 struct session * ses = &_session; 
    386  int new_session = getenv("ROAR_OSS_NEW_SESSION") == NULL ? 0 : 1; 
     386 int new_session = roar_env_get("ROAR_OSS_NEW_SESSION") == NULL ? 0 : 1; 
    387387 
    388388 ROAR_DBG("_open_session(server='%s', name='%s') = ?", server, name); 
     
    400400 
    401401  if ( name == NULL ) 
    402    name = getenv("ROAR_OSS_CLIENT_NAME"); 
     402   name = roar_env_get("ROAR_OSS_CLIENT_NAME"); 
    403403 
    404404  if ( name == NULL ) 
     
    415415 
    416416  if ( !new_session ) { 
    417    if ( getenv("ROAR_OSS_KEEP_SESSION") != NULL ) 
     417   if ( roar_env_get("ROAR_OSS_KEEP_SESSION") != NULL ) 
    418418    ses->refc++; 
    419419  } 
Note: See TracChangeset for help on using the changeset viewer.