Commit e4d85e56 authored by Simon Morlat's avatar Simon Morlat

fix bug with config file parsing with \r

parent 32881a74
......@@ -435,13 +435,13 @@ static void sound_config_read(LinphoneCore *lc)
tmpbuf=PACKAGE_SOUND_DIR "/" LOCAL_RING;
tmpbuf=lp_config_get_string(lc->config,"sound","local_ring",tmpbuf);
if (ortp_file_exist(tmpbuf)==-1) {
ms_warning("%s does not exist",tmpbuf);
tmpbuf=PACKAGE_SOUND_DIR "/" LOCAL_RING;
}
if (strstr(tmpbuf,".wav")==NULL){
/* it currently uses old sound files, so replace them */
tmpbuf=PACKAGE_SOUND_DIR "/" LOCAL_RING;
}
linphone_core_set_ring(lc,tmpbuf);
tmpbuf=PACKAGE_SOUND_DIR "/" REMOTE_RING;
......
......@@ -177,7 +177,9 @@ void lp_config_parse(LpConfig *lpconfig, FILE *file){
if (sscanf(tmp,"%s",key)>0){
pos1++;
pos2=strchr(pos1,'\n');
pos2=strchr(pos1,'\r');
if (pos2==NULL)
pos2=strchr(pos1,'\n');
if (pos2==NULL) pos2=pos1+strlen(pos1);
else {
*pos2='\0'; /*replace the '\n' */
......
mediastreamer2 @ 5c139fbb
Subproject commit 6f0c042a6facbb7bc21ff6e56151d762e1fb9c8e
Subproject commit 5c139fbb21e7715b36a0b7e609d821f74dd01b8d
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment