From e8292035968488eb3a9b61a431afc8c9a39f51d3 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Thu, 1 Jan 2009 22:08:21 +0000 Subject: Fixed gcc-4.3.2 warnings with the warn_unused_result flag in some APIs git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2408 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip-apps/src/pjsua/pjsua_app.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'pjsip-apps/src/pjsua/pjsua_app.c') diff --git a/pjsip-apps/src/pjsua/pjsua_app.c b/pjsip-apps/src/pjsua/pjsua_app.c index 882a11bc..5414b087 100644 --- a/pjsip-apps/src/pjsua/pjsua_app.c +++ b/pjsip-apps/src/pjsua/pjsua_app.c @@ -2750,7 +2750,8 @@ static pj_bool_t simple_input(const char *title, char *buf, pj_size_t len) char *p; printf("%s (empty to cancel): ", title); fflush(stdout); - fgets(buf, len, stdin); + if (fgets(buf, len, stdin) == NULL) + return PJ_FALSE; /* Remove trailing newlines. */ for (p=buf; ; ++p) { @@ -2794,7 +2795,8 @@ static void ui_input_url(const char *title, char *buf, int len, printf("%s: ", title); fflush(stdout); - fgets(buf, len, stdin); + if (fgets(buf, len, stdin) == NULL) + return; len = strlen(buf); /* Left trim */ @@ -3023,7 +3025,8 @@ static void manage_codec_prio(void) "(e.g. \"speex/16000 200\"), empty to cancel:"); printf("Codec name (\"*\" for all) and priority: "); - fgets(input, sizeof(input), stdin); + if (fgets(input, sizeof(input), stdin) == NULL) + return; if (input[0]=='\r' || input[0]=='\n') { puts("Done"); return; -- cgit v1.2.3