[PATCH] Bug #425

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

attached is patch that should fix #425
(http://bugs.kannel.org/view.php?id=425).

Comments please?

-- 
Thanks,
Alex
html.diff (text/x-diff, 975 B)
=== gw/html.c
==================================================================
--- gw/html.c	(revision 308)
+++ gw/html.c	(local)
@@ -246,14 +246,20 @@
     size_t len;
     char buf[1024];
 
-    if (octstr_get_char(html, (*pos) + 1) == '#') {
-        i = octstr_parse_long(&code, html, (*pos) + 2, 10);
+    if (octstr_get_char(html, *pos + 1) == '#') {
+        if (octstr_get_char(html, *pos + 2) == 'x' || octstr_get_char(html, *pos + 2) == 'X')
+            i = octstr_parse_long(&code, html, *pos + 3, 16); /* hex */
+        else
+            i = octstr_parse_long(&code, html, *pos + 2, 10); /* decimal */
         if (i > 0) {
             if (code < 256)
                 octstr_append_char(sms, code);
             *pos = i + 1;
             if (octstr_get_char(html, *pos) == ';')
                 ++(*pos);
+        } else {
+            ++(*pos);
+            octstr_append_char(sms, '&');
         }
     } else {
         for (i = 0; i < num_tab; ++i) {
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.