Re: [PATCH] Avoid segfaults on solaris while printing debug msgs in wml_compiler.c

Alexander Malysh <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Organization Centrium GmbH
Message-ID <[email protected]>
Hi Paul,

would you please resend this patch as attachment instead of inlined one.

Thanks...


On Monday 09 February 2004 08:23, Paul P Komkoff Jr wrote:
> That's what I'm told
>
>
> --- gateway/gw/wml_compiler.c	2004-01-22 17:08:24.000000000 +0300
> +++ gw/gw/wml_compiler.c	2004-02-07 15:45:17.000000000 +0300
> @@ -819,6 +819,7 @@
>      int i, pos, wbxml_hex;
>      wml_hash_t *temp = NULL;
>      Octstr *cut_text = NULL;
> +    char* tmp;
>
>      /*
>       * Beware that libxml2 does internal encoding in UTF-8 while parsing.
> @@ -826,12 +827,13 @@
>       * to transcode at least here. Only transcode if target encoding
> differs * from libxml2's internal encoding (UTF-8).
>       */
> +    tmp = xmlGetCharEncodingName(charset);
>      if (charset != XML_CHAR_ENCODING_UTF8 &&
>          charset_convert(attr_value, "UTF-8",
> -                        (char*) xmlGetCharEncodingName(charset)) != 0) {
> +                        tmp) != 0) {
>          error(0, "Failed to convert XML attribute value from charset "
>                   "<%s> to <%s>, will leave as is.", "UTF-8",
> -                 xmlGetCharEncodingName(charset));
> +                 tmp ? tmp : "(undef)");
>      }
>
>
> @@ -921,6 +923,7 @@
>  {
>      int ret;
>      Octstr *temp;
> +    char* tmp;
>
>      temp = create_octstr_from_node(node); /* returns string in UTF-8 */
>
> @@ -930,12 +933,13 @@
>       * to transcode at least here. Only transcode if target encoding
> differs * from libxml2's internal encoding (UTF-8).
>       */
> +    tmp = xmlGetCharEncodingName(node->doc->charset);
>      if (node->doc->charset != XML_CHAR_ENCODING_UTF8 &&
>          charset_convert(temp, "UTF-8",
> -                        (char*)
> xmlGetCharEncodingName(node->doc->charset)) != 0) { +                      
>  tmp) != 0) {
>          error(0, "Failed to convert XML text entity from charset "
>                   "<%s> to <%s>, will leave as is.", "UTF-8",
> -                 xmlGetCharEncodingName(node->doc->charset));
> +                 tmp ? tmp : "(undef)");
>      }
>
>      octstr_shrink_blanks(temp);

-- 
Best regards / Mit besten Grüßen aus Düsseldorf

Dipl.-Ing.
Alexander Malysh
___________________________________________

Centrium GmbH
Vogelsanger Weg 80
40470 Düsseldorf

Fon: +49 (0211) 74 84 51 80
Fax: +49 (0211) 277 49 109

email: [email protected]
web: www.centrium.de
msn: [email protected]
icq: 98063111
___________________________________________

Please avoid sending me Word, Excel or PowerPoint attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.