Hi Fred,

> I think you did spot a real problem here, but your solution just doesn't
> look right. An unsigned number never should be allowed to wrap around.
> What about a check like this:

With casts like this it works:

     if (layout_char > r.location)
       {
          if ((int)layout_char + lengthChange < (int)r.location)
          {
             layout_char = r.location;
          }
        else
          {
             layout_char += lengthChange;
          }
       }

The attached patch also works for the current CVS version.

Georg


*** gui/Source/NSLayoutManager.m.old    2004-03-14 01:15:46.000000000 +0100
--- gui/Source/NSLayoutManager.m        2004-03-14 01:41:56.000000000 +0100
***************
*** 1798,1804 ****

    if (layout_char > r.location)
      {
!       if (layout_char >= r.location + r.length)
        layout_char += lengthChange;
        else
        {
--- 1798,1804 ----

    if (layout_char > r.location)
      {
!       if ((int)layout_char + lengthChange >= (int)r.location)
        layout_char += lengthChange;
        else
        {


_______________________________________________
Bug-gnustep mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-gnustep

Reply via email to