Update doc/common
[yaz-moved-to-github.git] / src / icu_chain.c
index 730edde..6aac1c0 100644 (file)
@@ -1,5 +1,5 @@
 /* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2013 Index Data
+ * Copyright (C) Index Data
  * See the file LICENSE for details.
  */
 
@@ -291,7 +291,7 @@ struct icu_chain *icu_chain_xml_config(const xmlNode *xml_node,
 
         if (!rule && strcmp((const char *) node->name, "display"))
         {
-            yaz_log(YLOG_WARN, "Missing attribute rule for element %s",
+            yaz_log(YLOG_WARN, "Missing attribute 'rule' for element %s",
                     (const char *) node->name);
             no_errors++;
             continue;
@@ -346,6 +346,9 @@ struct icu_chain *icu_chain_xml_config(const xmlNode *xml_node,
         }
         if (step && U_FAILURE(*status))
         {
+            yaz_log(YLOG_WARN, "ICU Error %d %s for element %s, rule %s",
+                    *status, u_errorName(*status), node->name, rule ?
+                    rule : "");
             no_errors++;
             break;
         }
@@ -567,7 +570,7 @@ void icu_iter_get_org_info(yaz_icu_iter_t iter, size_t *start, size_t *len)
     int32_t save_len = iter->org->utf16_len;
 
     struct icu_buf_utf8 *tmp = icu_buf_utf8_create(0);
-    UErrorCode status;
+    UErrorCode status = U_ZERO_ERROR;
 
     iter->org->utf16_len = iter->org_start;
     icu_utf16_to_utf8(tmp, iter->org, &status);
@@ -581,6 +584,7 @@ void icu_iter_get_org_info(yaz_icu_iter_t iter, size_t *start, size_t *len)
         *len = tmp->utf8_len - *start;
     else
         *len = 0;
+    icu_buf_utf8_destroy(tmp);
     iter->org->utf16_len = save_len;
 }