bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Corrections for 20030809


From: Philippe Blain
Subject: Corrections for 20030809
Date: Wed, 13 Aug 2003 06:49:53 +0200

>From Philippe Blain, Bordeaux, France.
My computer: P133 - 8,4 Go - 32 Mo Red Hat Linux 7.0
[ Added today a SilentDrive from Silent Systems, Ma.
  Good, but still power supply fan doing some noise... ]

Subject: Corrections for ncurses-5.3-20030809+

1-----------------------------------------------------------------------
File : ncurses/tty/lib_mvcur.c

Lines 523 and 526 :
Cost of parm_up_cursor is _cuu_cost and NOT _cup_cost
(error since 1.9.9g at least).
No visible consequence because linux entry has no parm_up_cursor.

Use CURRENT_ATTR instead of REAL_ATTR (the same).
And lines :
    #if defined(REAL_ATTR) && defined(WANT_CHAR)
    #endif /* defined(REAL_ATTR) && defined(WANT_CHAR) */
can be suppressed because REAL_ATTR and WANT_CHAR are always localy defined
(depend of ovw [overwrite] only).

2-----------------------------------------------------------------------
File : ncurses/tinfo/strings.c

In _nc_safe_strcpy(), something wrong with s_size.
As we copy on s_head, s_size should be set to :
         initial_free_size of string_desc (unknown) - strlen(src)
Not visible because OPT_SIZE is large enough (512).

Another approach would be to limit OPT_SIZE to the length of cup (8)
and control that other tactics do not cross that length.

NCURSES_EXPORT (bool)
_nc_safe_strcpy (string_desc * dst, const char *src)
{
==> if (dst != 0 && src != 0) {
        size_t len = strlen (src);

        /* s_size can have been modified since creation
            (by a precedent _nc_safe_strcpy() for ex.) */

==>     if (len < dst->s_size) {
            if (dst->s_head != 0) {
                strcpy (dst->s_head, src);
                dst->s_tail = dst->s_head + len;
==>             dst->s_size = ???parameter??? - len;
==>             return TRUE;
==>         }
        }
    }
    return FALSE;
}
------------------------------------------------------------------------
- Philippe






reply via email to

[Prev in Thread] Current Thread [Next in Thread]