Changeset 5838:52ca1a88734e in roaraudio for libroar/config.c
- Timestamp:
- 01/07/13 02:36:01 (11 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroar/config.c
r5833 r5838 36 36 #include "libroar.h" 37 37 38 #define LEN_AUTHFILE 1024 39 38 40 static struct roar_libroar_config_codec * 39 41 roar_libroar_config_codec_get_conf(int32_t codec, int create, struct roar_libroar_config * config); … … 43 45 static struct roar_libroar_config config; 44 46 static int inited = 0; 45 static char authfile[ 1024];47 static char authfile[LEN_AUTHFILE]; 46 48 const char * home = roar_env_get_home(0); 47 49 … … 102 104 config->codecs.num = 0; 103 105 } 106 107 if ( config->x11.display != NULL ) 108 roar_mm_free(config->x11.display); 109 config->x11.display = NULL; 110 111 if ( config->daemonimage != NULL ) 112 roar_mm_free(config->daemonimage); 113 config->daemonimage = NULL; 104 114 105 115 return 0; … … 308 318 roar_libroar_set_server(v); 309 319 } else if ( !strcmp(k, "set-authfile") ) { 310 strncpy(config->authfile, v, 1023);311 config->authfile[ 1023] = 0;320 strncpy(config->authfile, v, LEN_AUTHFILE-1); 321 config->authfile[LEN_AUTHFILE-1] = 0; 312 322 } else if ( !strcmp(k, "x11-display") ) { 313 config->x11.display = v; 323 if ( config->x11.display != NULL ) 324 roar_mm_free(config->x11.display); 325 config->x11.display = roar_mm_strdup(v); 314 326 } else if ( !strcmp(k, "daemonimage") ) { 315 config->daemonimage = v; 327 if ( config->daemonimage != NULL ) 328 roar_mm_free(config->daemonimage); 329 config->daemonimage = roar_mm_strdup(v); 316 330 } else if ( !strcmp(k, "serverflags") ) { 317 331 if ( !strcmp(v, "nonblock") ) {
Note: See TracChangeset
for help on using the changeset viewer.