[tracker/parser-unicode-libs-review] ucnv_fromUChars already NIL-terminates the string
- From: Aleksander Morgado <aleksm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/parser-unicode-libs-review] ucnv_fromUChars already NIL-terminates the string
- Date: Wed, 5 May 2010 14:31:47 +0000 (UTC)
commit c0191cf1c45fb469fc6363cfeac9d7ce6c94fe77
Author: Aleksander Morgado <aleksander lanedo com>
Date: Wed May 5 16:31:29 2010 +0200
ucnv_fromUChars already NIL-terminates the string
src/libtracker-fts/tracker-parser-libicu.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/src/libtracker-fts/tracker-parser-libicu.c b/src/libtracker-fts/tracker-parser-libicu.c
index 5a4f1e3..cf15ffa 100644
--- a/src/libtracker-fts/tracker-parser-libicu.c
+++ b/src/libtracker-fts/tracker-parser-libicu.c
@@ -502,7 +502,7 @@ process_word_uchar (TrackerParser *parser,
/* Using same buffer size as for UTF-16 should always work. */
utf8_str = g_malloc (new_word_length * sizeof (UChar) + 1);
- /* Convert from UChar to UTF-8 */
+ /* Convert from UChar to UTF-8 (NIL-terminated) */
utf8_len = ucnv_fromUChars (converter,
utf8_str,
new_word_length * sizeof (UChar) + 1,
@@ -517,7 +517,6 @@ process_word_uchar (TrackerParser *parser,
return NULL;
}
- utf8_str[utf8_len] = '\0';
new_word_length = utf8_len;
ucnv_close (converter);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]