- Timestamp:
- Jan 1, 2009 10:08:21 PM (16 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib-util/src/pjlib-util-test/main.c
r2394 r2408 55 55 56 56 puts("Press ENTER to quit"); 57 fgets(s, sizeof(s), stdin); 57 if (fgets(s, sizeof(s), stdin) == NULL) 58 return rc; 58 59 } 59 60 -
pjproject/trunk/pjlib/src/pjlib-test/main.c
r2394 r2408 99 99 puts(""); 100 100 puts("Press <ENTER> to exit"); 101 fgets(s, sizeof(s), stdin); 101 if (!fgets(s, sizeof(s), stdin)) 102 return rc; 102 103 } 103 104 -
pjproject/trunk/pjmedia/src/test/main.c
r2394 r2408 40 40 if (argc == 2 && argv[1][0]=='-' && argv[1][1]=='i') { 41 41 puts("\nPress <ENTER> to quit"); 42 fgets(s, sizeof(s), stdin); 42 if (fgets(s, sizeof(s), stdin) == NULL) 43 return rc; 43 44 } 44 45 -
pjproject/trunk/pjmedia/src/test/rtp_test.c
r2394 r2408 33 33 pjmedia_rtp_session_init (&rtp, 4, 0x12345678); 34 34 pjmedia_rtp_encode_rtp (&rtp, 4, 0, 0, 160, &rtphdr, &hdrlen); 35 fwrite (rtphdr, hdrlen, 1, fhnd); 35 if (fwrite (rtphdr, hdrlen, 1, fhnd) != 1) { 36 fclose(fhnd); 37 return -1; 38 } 36 39 fclose(fhnd); 37 40 return 0; -
pjproject/trunk/pjnath/src/pjnath-test/main.c
r2394 r2408 54 54 55 55 puts("Press <ENTER> to exit"); 56 fgets(buf, sizeof(buf), stdin); 56 if (fgets(buf, sizeof(buf), stdin) == NULL) 57 return rc; 57 58 } 58 59 -
pjproject/trunk/pjnath/src/pjturn-client/client_main.c
r2394 r2408 446 446 menu(); 447 447 448 fgets(input, sizeof(input), stdin); 448 if (fgets(input, sizeof(input), stdin) == NULL) 449 break; 449 450 450 451 switch (input[0]) { -
pjproject/trunk/pjnath/src/pjturn-srv/main.c
r2394 r2408 109 109 menu(); 110 110 111 fgets(line, sizeof(line), stdin); 111 if (fgets(line, sizeof(line), stdin) == NULL) 112 break; 112 113 113 114 switch (line[0]) { -
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
r2394 r2408 2751 2751 2752 2752 printf("%s (empty to cancel): ", title); fflush(stdout); 2753 fgets(buf, len, stdin); 2753 if (fgets(buf, len, stdin) == NULL) 2754 return PJ_FALSE; 2754 2755 2755 2756 /* Remove trailing newlines. */ … … 2795 2796 2796 2797 fflush(stdout); 2797 fgets(buf, len, stdin); 2798 if (fgets(buf, len, stdin) == NULL) 2799 return; 2798 2800 len = strlen(buf); 2799 2801 … … 3024 3026 3025 3027 printf("Codec name (\"*\" for all) and priority: "); 3026 fgets(input, sizeof(input), stdin); 3028 if (fgets(input, sizeof(input), stdin) == NULL) 3029 return; 3027 3030 if (input[0]=='\r' || input[0]=='\n') { 3028 3031 puts("Done"); -
pjproject/trunk/pjsip-apps/src/samples/confsample.c
r2394 r2408 106 106 107 107 printf("%s (empty to cancel): ", title); fflush(stdout); 108 fgets(buf, len, stdin); 108 if (fgets(buf, len, stdin) == NULL) 109 return PJ_FALSE; 109 110 110 111 /* Remove trailing newlines. */ … … 269 270 char tmp2[10]; 270 271 char *err; 271 int src, dst, level ;272 int src, dst, level, dur; 272 273 273 274 puts(""); … … 286 287 printf("Enter selection: "); fflush(stdout); 287 288 288 fgets(tmp, sizeof(tmp), stdin); 289 if (fgets(tmp, sizeof(tmp), stdin) == NULL) 290 break; 289 291 290 292 switch (tmp[0]) { … … 416 418 if (!input("Duration to monitor (in seconds)", tmp1, sizeof(tmp1)) ) 417 419 continue; 418 strtol(tmp1, &err, 10);420 dur = strtol(tmp1, &err, 10); 419 421 if (*err) { 420 422 puts("Invalid duration number"); … … 422 424 } 423 425 424 monitor_level(conf, src, tmp2[0], strtol(tmp1, &err, 10));426 monitor_level(conf, src, tmp2[0], dur); 425 427 break; 426 428 -
pjproject/trunk/pjsip-apps/src/samples/mix.c
r2394 r2408 130 130 printf("File %s exists, overwrite? [Y/N] ", out_fname); 131 131 fflush(stdout); 132 fgets(in, sizeof(in), stdin); 132 if (fgets(in, sizeof(in), stdin) == NULL) 133 return 1; 133 134 if (pj_tolower(in[0]) != 'y') 134 135 return 1; -
pjproject/trunk/pjsip-apps/src/samples/pjsip-perf.c
r2394 r2408 1810 1810 } else { 1811 1811 /* Server mode */ 1812 char s[10] ;1812 char s[10], *unused; 1813 1813 pj_status_t status; 1814 1814 unsigned i; … … 1845 1845 puts("\nPress <ENTER> to quit\n"); 1846 1846 fflush(stdout); 1847 fgets(s, sizeof(s), stdin); 1847 unused = fgets(s, sizeof(s), stdin); 1848 PJ_UNUSED_ARG(unused); 1848 1849 1849 1850 app.thread_quit = PJ_TRUE; -
pjproject/trunk/pjsip-apps/src/samples/playfile.c
r2394 r2408 173 173 puts("Press <ENTER> to stop playing and quit"); 174 174 175 fgets(tmp, sizeof(tmp), stdin); 175 if (fgets(tmp, sizeof(tmp), stdin) == NULL) { 176 puts("EOF while reading stdin, will quit now.."); 177 } 176 178 177 179 -
pjproject/trunk/pjsip-apps/src/samples/playsine.c
r2394 r2408 278 278 puts("Press <ENTER> to stop playing and quit"); 279 279 280 fgets(tmp, sizeof(tmp), stdin); 280 if (fgets(tmp, sizeof(tmp), stdin) == NULL) { 281 puts("EOF while reading stdin, will quit now.."); 282 } 281 283 282 284 -
pjproject/trunk/pjsip-apps/src/samples/recfile.c
r2394 r2408 168 168 puts("Press <ENTER> to stop recording and quit"); 169 169 170 fgets(tmp, sizeof(tmp), stdin); 170 if (fgets(tmp, sizeof(tmp), stdin) == NULL) { 171 puts("EOF while reading stdin, will quit now.."); 172 } 171 173 172 174 -
pjproject/trunk/pjsip-apps/src/samples/resampleplay.c
r2394 r2408 191 191 puts("Press <ENTER> to stop playing and quit"); 192 192 193 fgets(tmp, sizeof(tmp), stdin); 194 193 if (fgets(tmp, sizeof(tmp), stdin) == NULL) { 194 puts("EOF while reading stdin, will quit now.."); 195 } 195 196 196 197 /* Start deinitialization: */ -
pjproject/trunk/pjsip-apps/src/samples/simple_pjsua.c
r2394 r2408 183 183 184 184 puts("Press 'h' to hangup all calls, 'q' to quit"); 185 fgets(option, sizeof(option), stdin); 185 if (fgets(option, sizeof(option), stdin) == NULL) { 186 puts("EOF while reading stdin, will quit now.."); 187 break; 188 } 186 189 187 190 if (option[0] == 'q') -
pjproject/trunk/pjsip-apps/src/samples/siprtp.c
r2394 r2408 1863 1863 1864 1864 printf("%s (empty to cancel): ", title); fflush(stdout); 1865 fgets(buf, len, stdin); 1865 if (fgets(buf, len, stdin) == NULL) 1866 return PJ_FALSE; 1866 1867 1867 1868 /* Remove trailing newlines. */ … … 1899 1900 for (;;) { 1900 1901 printf(">>> "); fflush(stdout); 1901 fgets(input1, sizeof(input1), stdin); 1902 if (fgets(input1, sizeof(input1), stdin) == NULL) { 1903 puts("EOF while reading stdin, will quit now.."); 1904 break; 1905 } 1902 1906 1903 1907 switch (input1[0]) { … … 2021 2025 2022 2026 if (log_file) { 2023 fwrite(buffer, len, 1, log_file); 2027 int count = fwrite(buffer, len, 1, log_file); 2028 PJ_UNUSED_ARG(count); 2024 2029 fflush(log_file); 2025 2030 } -
pjproject/trunk/pjsip-apps/src/samples/sndinfo.c
r2394 r2408 203 203 //pj_thread_sleep(1000); 204 204 puts("Press <ENTER> to stop"); 205 fgets(tmp, sizeof(tmp), stdin); 206 205 if (fgets(tmp, sizeof(tmp), stdin) == NULL) { 206 puts("EOF while reading stdin, will quit now.."); 207 } 207 208 208 209 pjmedia_snd_stream_close(strm); -
pjproject/trunk/pjsip-apps/src/samples/stateful_proxy.c
r2394 r2408 556 556 ""); 557 557 558 fgets(line, sizeof(line), stdin); 558 if (fgets(line, sizeof(line), stdin) == NULL) { 559 puts("EOF while reading stdin, will quit now.."); 560 global.quit_flag = PJ_TRUE; 561 break; 562 } 559 563 560 564 if (line[0] == 'q') { -
pjproject/trunk/pjsip-apps/src/samples/stateless_proxy.c
r2394 r2408 222 222 ""); 223 223 224 fgets(line, sizeof(line), stdin); 224 if (fgets(line, sizeof(line), stdin) == NULL) { 225 puts("EOF while reading stdin, will quit now.."); 226 global.quit_flag = PJ_TRUE; 227 break; 228 } 225 229 226 230 if (line[0] == 'q') { -
pjproject/trunk/pjsip-apps/src/samples/stereotest.c
r2394 r2408 296 296 puts("Press <ENTER> to stop and quit"); 297 297 298 fgets(tmp, sizeof(tmp), stdin); 299 298 if (fgets(tmp, sizeof(tmp), stdin) == NULL) { 299 puts("EOF while reading stdin, will quit now.."); 300 } 300 301 301 302 /* Start deinitialization: */ -
pjproject/trunk/pjsip-apps/src/samples/streamutil.c
r2394 r2408 617 617 printf("Command: "); fflush(stdout); 618 618 619 fgets(tmp, sizeof(tmp), stdin); 619 if (fgets(tmp, sizeof(tmp), stdin) == NULL) { 620 puts("EOF while reading stdin, will quit now.."); 621 break; 622 } 620 623 621 624 if (tmp[0] == 's') -
pjproject/trunk/pjsip-apps/src/samples/tonegen.c
r2394 r2408 128 128 129 129 for (i=0; i<8000/SAMPLES_PER_FRAME; ++i) { 130 int count; 130 131 pjmedia_port_get_frame(port, &frm); 131 fwrite(buf, SAMPLES_PER_FRAME, 2, f); 132 count = fwrite(buf, SAMPLES_PER_FRAME, 2, f); 133 if (count != 2) 134 break; 132 135 } 133 136 -
pjproject/trunk/pjsip/src/test-pjsip/main.c
r2394 r2408 83 83 char s[10]; 84 84 printf("<Press ENTER to quit>\n"); fflush(stdout); 85 fgets(s, sizeof(s), stdin); 85 if (fgets(s, sizeof(s), stdin) == NULL) 86 return retval; 86 87 } 87 88
Note: See TracChangeset
for help on using the changeset viewer.