summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2005-11-17 11:51:33 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2005-11-17 11:51:33 +0000
commitc0f495618efe564a10139c3c953b1fb2d59a58e4 (patch)
tree5ed60c40f00d28ea2e0c046b90f2cf97f5265fb9
parentb9331c51d17a00fc7fe9a81dd1c1691dd23819be (diff)
downloadpango-c0f495618efe564a10139c3c953b1fb2d59a58e4.tar.gz
Remove g_utf8_strlen that was only used to give a warning.
2005-11-17 Behdad Esfahbod <behdad@gnome.org> * 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.
-rw-r--r--ChangeLog8
-rw-r--r--pango/break.c11
2 files changed, 9 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 1d1aeb81..085172ee 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2005-11-17 Behdad Esfahbod <behdad@gnome.org>
+ * 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.
+
+2005-11-17 Behdad Esfahbod <behdad@gnome.org>
+
* docs/tmpl/coverage-maps.sgml docs/tmpl/fonts.sgml
docs/tmpl/glyphs.sgml docs/tmpl/layout.sgml
docs/tmpl/main.sgml docs/tmpl/scripts.sgml
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;