Fixed gcc-4.3.2 warnings with the warn_unused_result flag in some APIs
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@2408 74dad513-b988-da41-8d7b-12977e46ad98
diff --git a/pjsip-apps/src/samples/siprtp.c b/pjsip-apps/src/samples/siprtp.c
index e98084b..b3e3d7d 100644
--- a/pjsip-apps/src/samples/siprtp.c
+++ b/pjsip-apps/src/samples/siprtp.c
@@ -1862,7 +1862,8 @@
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) {
@@ -1898,7 +1899,10 @@
for (;;) {
printf(">>> "); fflush(stdout);
- fgets(input1, sizeof(input1), stdin);
+ if (fgets(input1, sizeof(input1), stdin) == NULL) {
+ puts("EOF while reading stdin, will quit now..");
+ break;
+ }
switch (input1[0]) {
@@ -2020,7 +2024,8 @@
pj_log_write(level, buffer, len);
if (log_file) {
- fwrite(buffer, len, 1, log_file);
+ int count = fwrite(buffer, len, 1, log_file);
+ PJ_UNUSED_ARG(count);
fflush(log_file);
}
}