Changeset 5006:1a7ae9683375 in roaraudio
- Timestamp:
- 05/24/11 21:30:56 (13 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroar/config.c
r4957 r5006 94 94 int codec; 95 95 char * codec_str, * option_str, * value_str; 96 char * toksave = NULL; 96 97 97 98 ROAR_DBG("roar_libroar_config_parse_codec(config=%p, txt='%s') = ?", config, txt); … … 102 103 ROAR_DBG("roar_libroar_config_parse_codec(config=%p, txt='%s') = ?", config, txt); 103 104 104 codec_str = strtok(txt, ":");105 codec_str = roar_mm_strtok_r(txt, ":", &toksave); 105 106 106 107 if ( codec_str == NULL ) 107 108 return -1; 108 109 109 option_str = strtok(NULL, ":");110 option_str = roar_mm_strtok_r(NULL, ":", &toksave); 110 111 111 112 if ( option_str == NULL ) 112 113 return -1; 113 114 114 value_str = strtok(NULL, ":");115 value_str = roar_mm_strtok_r(NULL, ":", &toksave); 115 116 116 117 if ( value_str == NULL ) … … 170 171 int roar_libroar_config_parse(char * txt, char * delm) { 171 172 struct roar_libroar_config * config = roar_libroar_get_config_ptr(); 173 ssize_t len; 172 174 char * k, * v, * next = txt; 173 175 … … 195 197 196 198 // strip tailing new lions: 197 v = strtok(k, "\r\n"); 198 if ( v != NULL ) { 199 if ( *v == '\r' || *v == '\n' ) 200 *v = 0; 201 } 199 len = roar_mm_strlen(k); 200 if ( len != -1 ) 201 for (len--; len && (k[len] == '\r' || k[len] == '\n'); len--) 202 k[len] = 0; 202 203 203 204 ROAR_DBG("roar_libroar_config_parse(*): k='%s'", k);
Note: See TracChangeset
for help on using the changeset viewer.