This bug is because linphonec_parse_command_line() is passed a string in
cl even when fgets() in linphonec_main_loop() returns NULL;
A simple fix is attached. It makes the application exit cleanly if
that fgets() return zero, or giving a Ctrl-D alone as a command ends
the program.
There are at least one more fgets() which never gets its return value
checked in linphone_prompt_for_auth_final(). Possibly others.
--
/Martin
diff -ur ../linphone-1.1.0/console/linphonec.c
linphone-1.1.0/console/linphonec.c
--- ../linphone-1.1.0/console/linphonec.c 2005-08-05 13:12:28.000000000
+0200
+++ linphone-1.1.0/console/linphonec.c 2005-10-19 12:10:50.912568418 +0200
@@ -154,9 +154,13 @@
continue;
}
- fgets (input, LINE_MAX_LEN-1, stdin);
- run=linphonec_parse_command_line(&linphonec,input);
- printf("linphonec> ");fflush(stdout);
+ if(fgets (input, LINE_MAX_LEN-1, stdin))
+ {
+ run=linphonec_parse_command_line(&linphonec,input);
+ printf("linphonec> ");fflush(stdout);
+ }
+ else
+ run=FALSE;
}
printf("\n");
return 0;