1
0
Fork 0

minor bug fix.

This commit is contained in:
bagyenda 2005-04-01 12:32:25 +00:00
parent 1b08584a1a
commit 3a5ac7c59e
2 changed files with 11 additions and 11 deletions

View File

@ -38,18 +38,18 @@ static Octstr *mms_detokenize(Octstr * token)
if (script == NULL || octstr_len(script) == 0) if (script == NULL || octstr_len(script) == 0)
return NULL; return NULL;
cmd = octstr_format("%s '%s'", octstr_get_cstr(script), octstr_get_cstr(token)); cmd = octstr_format("%s '%s'", octstr_get_cstr(script), octstr_get_cstr(token));
info(0, "Calling \"%s\"", octstr_get_cstr(cmd)); info(0, "Calling \"%s\"", octstr_get_cstr(cmd));
if ((fp = popen(octstr_get_cstr(cmd), "r"))) { if ((fp = popen(octstr_get_cstr(cmd), "r"))) {
if (fgets(buf, 4096, fp) == buf) { if (fgets(buf, sizeof buf, fp) != NULL) {
msisdn = octstr_create(buf); msisdn = octstr_create(buf);
octstr_strip_crlfs(msisdn); octstr_strip_crlfs(msisdn);
} }
pclose(fp); pclose(fp);
} }
octstr_destroy(cmd); octstr_destroy(cmd);
return msisdn; return msisdn;
} }
/* The function itself. */ /* The function itself. */

View File

@ -303,7 +303,7 @@ Octstr *mms_find_sender_msisdn(Octstr **send_url, List *request_hdrs, Octstr *ms
if (octstr_len(p) > 0) if (octstr_len(p) > 0)
octstr_format_append(s, "/%S", p); octstr_format_append(s, "/%S", p);
} }
octstr_destroy(send_url); octstr_destroy(*send_url);
*send_url = s; *send_url = s;
} }
if (l) if (l)