From c0f495618efe564a10139c3c953b1fb2d59a58e4 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 17 Nov 2005 11:51:33 +0000 Subject: Remove g_utf8_strlen that was only used to give a warning. 2005-11-17 Behdad Esfahbod * pango/break.c (pango_get_log_attrs): Remove g_utf8_strlen that was only used to give a warning. * pango/break.c (pango_default_break): Add gcc-suggested parantheses around boolean expression. --- pango/break.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'pango/break.c') diff --git a/pango/break.c b/pango/break.c index bf50f349..4a7fcdef 100644 --- a/pango/break.c +++ b/pango/break.c @@ -593,7 +593,7 @@ pango_default_break (const gchar *text, { next = g_utf8_next_char (next); - if (length >= 0 && next == text + length || *next == '\0') + if ((length >= 0 && next >= text + length) || *next == '\0') { /* This is how we fill in the last element (end position) of the * attr array - assume there's a paragraph separators off the end @@ -1622,7 +1622,6 @@ pango_get_log_attrs (const char *text, PangoLogAttr *log_attrs, int attrs_len) { - int n_chars; PangoMap *lang_map; int chars_broken; const char *pos; @@ -1651,14 +1650,6 @@ pango_get_log_attrs (const char *text, render_type_id = g_quark_from_static_string (PANGO_RENDER_TYPE_NONE); } - n_chars = g_utf8_strlen (text, length); - - if (attrs_len < (n_chars + 1)) - { - g_warning ("pango_get_log_attrs(): length of PangoLogAttr array must be at least the number of chars in the text plus one more for the end position"); - return; - } - lang_map = pango_find_map (language, engine_type_id, render_type_id); range_start = text; -- cgit v1.2.1