1
0
Fork 0
mirror of https://git.freebsd.org/ports.git synced 2025-07-05 03:19:18 -04:00
ports/net/twinkle/files/patch-src-call_script.cpp
Jose Alonso Cardenas Marquez f171404c45 - New port: net/twinkle
Twinkle is a soft phone for your voice over IP communcations using the SIP
protocol.

You can use it for direct IP phone to IP phone communication or in a network
using a SIP proxy to route your calls.

WWW:    http://www.twinklephone.com/

Approved by:	garga (mentor)
2006-07-30 21:21:10 +00:00

33 lines
929 B
C++

--- src/call_script.cpp Wed Jul 12 13:20:34 2006
+++ src/call_script.cpp Wed Jul 12 13:23:34 2006
@@ -46,6 +46,8 @@
#define SCR_TRIGGER_LOCAL_RELEASE "local_release"
#define SCR_TRIGGER_REMOTE_RELEASE "remote_release"
+extern char **environ;
+
/////////////////////////
// class t_script_result
/////////////////////////
@@ -324,14 +326,16 @@
}
char *line_buf = NULL;
- size_t line_buf_len = 0;
- ssize_t num_read;
+ char *num_read;
+ int line_buf_len;
+ int count=0;
// Read and parse script results.
- while ((num_read = getline(&line_buf, &line_buf_len, fp_result)) != -1) {
+ while ((num_read = fgets(line_buf, sizeof(line_buf), fp_result)) != NULL) {
+ count++;
// Strip newline if present
- if (line_buf[num_read - 1] == '\n') {
- line_buf[num_read - 1] = 0;
+ if (line_buf[count - 1] == '\n') {
+ line_buf[count - 1] = 0;
}
// Convert the read line to a C++ string