repo: rxvt-unicode-sixel action: commit revision: path_from: revision_from: 6efc14de0e658352fa26a039905f0c6c73e87f25: path_to: revision_to:
commit 6efc14de0e658352fa26a039905f0c6c73e87f25 Author: Emanuele GiaquintaDate: Fri Jul 29 09:41:22 2011 +0000 Avoid undefined behaviour. diff --git a/src/main.C b/src/main.C
--- a/src/main.C
+++ b/src/main.C
@@ -107,7 +107,7 @@ text_t rxvt_composite_vec::compose (unicode_t c1, unicode_t c2)
}
// check to see whether this combination already exists otherwise
- for (cc = v.end (); cc-- > v.begin (); )
+ for (cc = v.begin (); cc < v.end (); cc++)
if (cc->c1 == c1 && cc->c2 == c2)
return COMPOSE_LO + (cc - v.begin ());
diff --git a/src/rxvtfont.C b/src/rxvtfont.C
--- a/src/rxvtfont.C
+++ b/src/rxvtfont.C
@@ -820,7 +820,7 @@ rxvt_font_x11::load (const rxvt_fontprop &prop, bool force_prop)
{
font_weight *best = fonts + count - 1;
- for (font_weight *w = best; w-- > fonts; )
+ for (font_weight *w = fonts; w < best; w++)
if (w->diff <= best->diff)
best = w;
@@ -926,7 +926,7 @@ rxvt_font_x11::load (const rxvt_fontprop &prop, bool force_prop)
width = 1;
- for (uint16_t *t = extent_test_chars + ecb_array_length (extent_test_chars); t-- > extent_test_chars; )
+ for (uint16_t *t = extent_test_chars; t < extent_test_chars + ecb_array_length (extent_test_chars); t++)
{
if (FROM_UNICODE (cs, *t) == NOCHAR)
continue;
@@ -1248,7 +1248,7 @@ rxvt_font_xft::load (const rxvt_fontprop &prop, bool force_prop)
int glheight = height;
- for (uint16_t *t = extent_test_chars + ecb_array_length (extent_test_chars); t-- > extent_test_chars; )
+ for (uint16_t *t = extent_test_chars; t < extent_test_chars + ecb_array_length (extent_test_chars); t++)
{
FcChar16 ch = *t;
-----END OF PAGE-----