-- Leo's gemini proxy

-- Connecting to git.thebackupbox.net:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

repo: rxvt-unicode-sixel
action: commit
revision:
path_from:
revision_from: 6efc14de0e658352fa26a039905f0c6c73e87f25:
path_to:
revision_to:

git.thebackupbox.net

rxvt-unicode-sixel

git://git.thebackupbox.net/rxvt-unicode-sixel

commit 6efc14de0e658352fa26a039905f0c6c73e87f25
Author: Emanuele Giaquinta <emanuele.giaquinta@gmail.com>
Date:   Fri Jul 29 09:41:22 2011 +0000

    Avoid undefined behaviour.

diff --git a/src/main.C b/src/main.C

index 38d9d16d0a9715f4522460177c70ea45f15bac7f..

index ..745facb4611be11319b778eb318830c9a5b49353 100644

--- 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

index d0578d8e38ca274fde951b7ae2cd5c216fc9a06c..

index ..46a38c4819f365816baa6c5ddbb9084d9f94e9d9 100644

--- 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-----

-- Response ended

-- Page fetched on Sun Jun 2 10:36:15 2024