From 3a5ac7c59e33f13231dde74ee0c33087dbf0f881 Mon Sep 17 00:00:00 2001 From: bagyenda <> Date: Fri, 1 Apr 2005 12:32:25 +0000 Subject: [PATCH] minor bug fix. --- mbuni/mmlib/mms_detokenize_shell.c | 20 ++++++++++---------- mbuni/mmlib/mms_util.c | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/mbuni/mmlib/mms_detokenize_shell.c b/mbuni/mmlib/mms_detokenize_shell.c index d740cc7..fb22f03 100644 --- a/mbuni/mmlib/mms_detokenize_shell.c +++ b/mbuni/mmlib/mms_detokenize_shell.c @@ -38,18 +38,18 @@ static Octstr *mms_detokenize(Octstr * token) if (script == NULL || octstr_len(script) == 0) return NULL; - + 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 (fgets(buf, 4096, fp) == buf) { - msisdn = octstr_create(buf); - octstr_strip_crlfs(msisdn); - } - pclose(fp); - } - octstr_destroy(cmd); - return msisdn; + if (fgets(buf, sizeof buf, fp) != NULL) { + msisdn = octstr_create(buf); + octstr_strip_crlfs(msisdn); + } + pclose(fp); + } + octstr_destroy(cmd); + return msisdn; } /* The function itself. */ diff --git a/mbuni/mmlib/mms_util.c b/mbuni/mmlib/mms_util.c index 3adbc58..a1caa0b 100644 --- a/mbuni/mmlib/mms_util.c +++ b/mbuni/mmlib/mms_util.c @@ -303,7 +303,7 @@ Octstr *mms_find_sender_msisdn(Octstr **send_url, List *request_hdrs, Octstr *ms if (octstr_len(p) > 0) octstr_format_append(s, "/%S", p); } - octstr_destroy(send_url); + octstr_destroy(*send_url); *send_url = s; } if (l)