diff options
author | Benny Prijono <bennylp@teluu.com> | 2009-01-01 22:08:21 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2009-01-01 22:08:21 +0000 |
commit | e8292035968488eb3a9b61a431afc8c9a39f51d3 (patch) | |
tree | 37b6e83a23282b53ed0ab8a602498798bb56c57d /pjsip-apps/src/samples/confsample.c | |
parent | 423bd3b19d5611412da90b87f6989dc89339defa (diff) |
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
Diffstat (limited to 'pjsip-apps/src/samples/confsample.c')
-rw-r--r-- | pjsip-apps/src/samples/confsample.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/pjsip-apps/src/samples/confsample.c b/pjsip-apps/src/samples/confsample.c index feb6aa11..676f4bb8 100644 --- a/pjsip-apps/src/samples/confsample.c +++ b/pjsip-apps/src/samples/confsample.c @@ -105,7 +105,8 @@ static pj_bool_t 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) { @@ -268,7 +269,7 @@ int main(int argc, char *argv[]) char tmp1[10]; char tmp2[10]; char *err; - int src, dst, level; + int src, dst, level, dur; puts(""); conf_list(conf, 0); @@ -285,7 +286,8 @@ int main(int argc, char *argv[]) printf("Enter selection: "); fflush(stdout); - fgets(tmp, sizeof(tmp), stdin); + if (fgets(tmp, sizeof(tmp), stdin) == NULL) + break; switch (tmp[0]) { case 's': @@ -415,13 +417,13 @@ int main(int argc, char *argv[]) if (!input("Duration to monitor (in seconds)", tmp1, sizeof(tmp1)) ) continue; - strtol(tmp1, &err, 10); + dur = strtol(tmp1, &err, 10); if (*err) { puts("Invalid duration number"); continue; } - monitor_level(conf, src, tmp2[0], strtol(tmp1, &err, 10)); + monitor_level(conf, src, tmp2[0], dur); break; case 'q': |