Changeset 2892:aba43608e324 in roaraudio for libroar/config.c


Ignore:
Timestamp:
10/10/09 02:36:54 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

corredted parsing function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/config.c

    r2891 r2892  
    8080  return -1; 
    8181 
    82  codec_str = txt; 
    83  
    84  option_str = strtok(txt, ":"); 
     82 codec_str = strtok(txt, ":"); 
     83 
     84 if ( codec_str == NULL ) 
     85  return -1; 
     86 
     87 option_str = strtok(NULL, ":"); 
    8588 
    8689 if ( option_str == NULL ) 
    8790  return -1; 
    8891 
    89  *option_str = 0; 
    90   option_str++; 
    91  
    92  value_str = strtok(option_str, ":"); 
     92 value_str = strtok(NULL, ":"); 
    9393 
    9494 if ( value_str == NULL ) 
    9595  return -1; 
    96  
    97  *value_str = 0; 
    98   value_str++; 
    9996 
    10097 if ( (codec = roar_str2codec(codec_str)) == -1 ) { 
     
    120117 } else { 
    121118  ROAR_WARN("roar_libroar_config_parse_codec(*): Unknown codec option: %s", option_str); 
    122  } 
    123  
    124  return -1; 
     119  return -1; 
     120 } 
     121 
     122 return 0; 
    125123} 
    126124 
Note: See TracChangeset for help on using the changeset viewer.