> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:GAksenov@;imbank.ru]

> Today i set up some check code into smsc_emi2.c:
> 
> --- smsc_emi2.orig      Wed Sep  4 21:08:52 2002
> +++ smsc_emi2.c Sun Nov 10 10:00:12 2002
> @@ -976,7 +976,11 @@ static int emi2_handle_smscreq (SMSCConn
>                   * Recode the msg structure with the given msgdata.
>                   * Note: the DLR URL is delivered in msg->sms.dlr_url
> already.
>                   */
> -                dlrmsg->sms.msgdata =
> octstr_duplicate(emimsg->fields[E50_AMSG]);
> +                               dlrmsg->sms.msgdata =
> octstr_duplicate(emimsg->fields[E50_AMSG]);
> +                if (dlrmsg->sms.msgdata == NULL) {
> +                                 dlrmsg->sms.msgdata = 
> octstr_create("");
> +                                 info(0, "EMI2[%s]: msgdata is NULL",
> octstr_get_cstr(privdata->name));
> +                }
>                  octstr_hex_to_binary(dlrmsg->sms.msgdata);

You can do it far easier with

dlrmsg->sms.msgdata = emimsg->fields[E50_AMSG] != NULL ? 
octstr_duplicate(emimsg->fields[E50_AMSG]) : octstr_create("");

and allow the compile to do some more optimizations if it likes to. you don't really 
need to log the fact that the message is empty : it gets sufficiently logged at other 
places.

--
Oded Arbel
m-Wise mobile solutions
[EMAIL PROTECTED]

+972-9-9581711 (116)
+972-67-340014

::..
If you sell diamonds, you cannot expect to have many customers.
But a diamond is a diamond even if there are no customers.
                -- Swami Prabhupada

Reply via email to